{*******************************************************} { MiTeC Common Routines } { Direct3D kernel mode transfer functions } { } { Copyright (c) by 1997-2021 Michal Mutl } { } {*******************************************************} {$INCLUDE Compilers.inc} {$Z4} unit MiTeC_NTD3DKMT; interface uses {$IFDEF RAD9PLUS}WinAPI.Windows{$ELSE}Windows{$ENDIF}, MiTeC_Windows; const GDI32DLL = 'gdi32.dll'; type D3DKMT_HANDLE = Cardinal; _D3DKMT_OPENADAPTERFROMDEVICENAME = record pDeviceName: PWideChar; hAdapter: D3DKMT_HANDLE; AdapterLuid: TLUID; end; D3DKMT_OPENADAPTERFROMDEVICENAME = _D3DKMT_OPENADAPTERFROMDEVICENAME; PD3DKMT_OPENADAPTERFROMDEVICENAME = ^D3DKMT_OPENADAPTERFROMDEVICENAME; _D3DKMT_OPENADAPTERFROMLUID = record AdapterLuid: TLUID; AdapterHandle: D3DKMT_HANDLE; end; D3DKMT_OPENADAPTERFROMLUID = _D3DKMT_OPENADAPTERFROMLUID; PD3DKMT_OPENADAPTERFROMLUID = ^D3DKMT_OPENADAPTERFROMLUID; _KMTQUERYADAPTERINFOTYPE = ( KMTQAITYPE_UMDRIVERPRIVATE, KMTQAITYPE_UMDRIVERNAME, KMTQAITYPE_UMOPENGLINFO, KMTQAITYPE_GETSEGMENTSIZE, KMTQAITYPE_ADAPTERGUID, KMTQAITYPE_FLIPQUEUEINFO, KMTQAITYPE_ADAPTERADDRESS, KMTQAITYPE_SETWORKINGSETINFO, KMTQAITYPE_ADAPTERREGISTRYINFO, KMTQAITYPE_CURRENTDISPLAYMODE, KMTQAITYPE_MODELIST, KMTQAITYPE_CHECKDRIVERUPDATESTATUS, KMTQAITYPE_VIRTUALADDRESSINFO, KMTQAITYPE_DRIVERVERSION, KMTQAITYPE_14, KMTQAITYPE_ADAPTERTYPE, KMTQAITYPE_OUTPUTDUPLCONTEXTSCOUNT, KMTQAITYPE_WDDM_1_2_CAPS, KMTQAITYPE_UMD_DRIVER_VERSION, KMTQAITYPE_DIRECTFLIP_SUPPORT, KMTQAITYPE_MULTIPLANEOVERLAY_SUPPORT, KMTQAITYPE_DLIST_DRIVER_NAME, KMTQAITYPE_WDDM_1_3_CAPS, KMTQAITYPE_MULTIPLANEOVERLAY_HUD_SUPPORT, KMTQAITYPE_WDDM_2_0_CAPS, KMTQAITYPE_NODEMETADATA, KMTQAITYPE_CPDRIVERNAME, KMTQAITYPE_XBOX, KMTQAITYPE_INDEPENDENTFLIP_SUPPORT, KMTQAITYPE_MIRACASTCOMPANIONDRIVERNAME, KMTQAITYPE_PHYSICALADAPTERCOUNT, KMTQAITYPE_PHYSICALADAPTERDEVICEIDS, KMTQAITYPE_DRIVERCAPS_EXT, KMTQAITYPE_QUERY_MIRACAST_DRIVER_TYPE, KMTQAITYPE_QUERY_GPUMMU_CAPS, KMTQAITYPE_QUERY_MULTIPLANEOVERLAY_DECODE_SUPPORT, KMTQAITYPE_QUERY_HW_PROTECTION_TEARDOWN_COUNT, KMTQAITYPE_QUERY_ISBADDRIVERFORHWPROTECTIONDISABLED, KMTQAITYPE_MULTIPLANEOVERLAY_SECONDARY_SUPPORT, KMTQAITYPE_INDEPENDENTFLIP_SECONDARY_SUPPORT, KMTQAITYPE_PANELFITTER_SUPPORT, KMTQAITYPE_PHYSICALADAPTERPNPKEY, KMTQAITYPE_GETSEGMENTGROUPSIZE, KMTQAITYPE_MPO3DDI_SUPPORT, KMTQAITYPE_HWDRM_SUPPORT, KMTQAITYPE_MPOKERNELCAPS_SUPPORT, KMTQAITYPE_MULTIPLANEOVERLAY_STRETCH_SUPPORT, KMTQAITYPE_GET_DEVICE_VIDPN_OWNERSHIP_INFO, KMTQAITYPE_QUERYREGISTRY, KMTQAITYPE_KMD_DRIVER_VERSION, KMTQAITYPE_BLOCKLIST_KERNEL, KMTQAITYPE_BLOCKLIST_RUNTIME, KMTQAITYPE_ADAPTERGUID_RENDER, KMTQAITYPE_ADAPTERADDRESS_RENDER, KMTQAITYPE_ADAPTERREGISTRYINFO_RENDER, KMTQAITYPE_CHECKDRIVERUPDATESTATUS_RENDER, KMTQAITYPE_DRIVERVERSION_RENDER, KMTQAITYPE_ADAPTERTYPE_RENDER, KMTQAITYPE_WDDM_1_2_CAPS_RENDER, KMTQAITYPE_WDDM_1_3_CAPS_RENDER, KMTQAITYPE_QUERY_ADAPTER_UNIQUE_GUID, KMTQAITYPE_NODEPERFDATA, KMTQAITYPE_ADAPTERPERFDATA, KMTQAITYPE_ADAPTERPERFDATA_CAPS, KMTQUITYPE_GPUVERSION, KMTQAITYPE_DRIVER_DESCRIPTION, KMTQAITYPE_DRIVER_DESCRIPTION_RENDER, KMTQAITYPE_SCANOUT_CAPS, KMTQAITYPE_PARAVIRTUALIZATION_RENDER, KMTQAITYPE_SERVICENAME, KMTQAITYPE_WDDM_2_7_CAPS, KMTQAITYPE_DISPLAY_UMDRIVERNAME, KMTQAITYPE_TRACKEDWORKLOAD_SUPPORT ); KMTQUERYADAPTERINFOTYPE = _KMTQUERYADAPTERINFOTYPE; _D3DKMT_DRIVERVERSION = ( KMT_DRIVERVERSION_WDDM_1_0 = 1000, // The display miniport driver supports the Windows Vista display driver model (WDDM) without Windows 7 features. KMT_DRIVERVERSION_WDDM_1_1_PRERELEASE = 1102, // The display miniport driver supports the Windows Vista display driver model with prereleased Windows 7 features. KMT_DRIVERVERSION_WDDM_1_1 = 1105, // The display miniport driver supports the Windows Vista display driver model with released Windows 7 features. KMT_DRIVERVERSION_WDDM_1_2 = 1200, // The display miniport driver supports the Windows Vista display driver model with released Windows 8 features. Supported starting with Windows 8. KMT_DRIVERVERSION_WDDM_1_3 = 1300, // The display miniport driver supports the Windows display driver model with released Windows 8.1 features. Supported starting with Windows 8.1. KMT_DRIVERVERSION_WDDM_2_0 = 2000, // The display miniport driver supports the Windows display driver model with released Windows 10 features. Supported starting with Windows 10. KMT_DRIVERVERSION_WDDM_2_1 = 2100, // 1607 KMT_DRIVERVERSION_WDDM_2_2 = 2200, // 1703 KMT_DRIVERVERSION_WDDM_2_3 = 2300, // 1709 KMT_DRIVERVERSION_WDDM_2_4 = 2400, // 1803 KMT_DRIVERVERSION_WDDM_2_5 = 2500, // 1809 KMT_DRIVERVERSION_WDDM_2_6 = 2600, // 19H1 KMT_DRIVERVERSION_WDDM_2_7 = 2700 // 20H1 ); D3DKMT_DRIVERVERSION = _D3DKMT_DRIVERVERSION; _KMTUMDVERSION = ( KMTUMDVERSION_DX9, KMTUMDVERSION_DX10, KMTUMDVERSION_DX11, KMTUMDVERSION_DX12, NUM_KMTUMDVERSIONS ); KMTUMDVERSION = _KMTUMDVERSION; _D3DKMT_ADAPTERTYPE = record { UINT32 RenderSupported : 1; UINT32 DisplaySupported : 1; UINT32 SoftwareDevice : 1; UINT32 PostDevice : 1; UINT32 HybridDiscrete : 1; // since WDDM1_3 UINT32 HybridIntegrated : 1; UINT32 IndirectDisplayDevice : 1; UINT32 Paravirtualized : 1; // since WDDM2_3 UINT32 ACGSupported : 1; UINT32 SupportSetTimingsFromVidPn : 1; UINT32 Detachable : 1; UINT32 ComputeOnly : 1; // since WDDM2_7 UINT32 Prototype : 1; UINT32 Reserved : 19; } Value: UINT32; end; D3DKMT_ADAPTERTYPE = _D3DKMT_ADAPTERTYPE; _D3DKMT_QUERYADAPTERINFO = record hAdapter: D3DKMT_HANDLE; Typ: KMTQUERYADAPTERINFOTYPE; pPrivateDriverData: Pointer; PrivateDriverDataSize: Cardinal; end; D3DKMT_QUERYADAPTERINFO = _D3DKMT_QUERYADAPTERINFO; PD3DKMT_QUERYADAPTERINFO = ^D3DKMT_QUERYADAPTERINFO; _D3DKMT_ADAPTERREGISTRYINFO = record AdapterString: array[0..MAX_PATH-1] of WideChar; BiosString: array[0..MAX_PATH-1] of WideChar; DacType: array[0..MAX_PATH-1] of WideChar; ChipType: array[0..MAX_PATH-1] of WideChar; end; D3DKMT_ADAPTERREGISTRYINFO = _D3DKMT_ADAPTERREGISTRYINFO; PD3DKMT_ADAPTERREGISTRYINFO = ^D3DKMT_ADAPTERREGISTRYINFO; {/// The D3DKMT_UMDFILENAMEINFO structure contains the name of an OpenGL ICD that is based on the specified version of the DirectX runtime. } _D3DKMT_UMDFILENAMEINFO = record Version: KMTUMDVERSION; UmdFileName: array[0..MAX_PATH-1] of WCHAR; end {_D3DKMT_UMDFILENAMEINFO}; D3DKMT_UMDFILENAMEINFO = _D3DKMT_UMDFILENAMEINFO; {/// The D3DKMT_OPENGLINFO structure describes OpenGL installable client driver (ICD) information. } _D3DKMT_OPENGLINFO = record UmdOpenGlIcdFileName: array[0..MAX_PATH-1] of WCHAR; Version: ULONG; Flags: ULONG; end {_D3DKMT_OPENGLINFO}; D3DKMT_OPENGLINFO = _D3DKMT_OPENGLINFO; {/// The D3DKMT_SEGMENTSIZEINFO structure describes the size, in bytes, of memory and aperture segments. } _D3DKMT_SEGMENTSIZEINFO = record DedicatedVideoMemorySize: ULONGLONG; DedicatedSystemMemorySize: ULONGLONG; SharedSystemMemorySize: ULONGLONG; end {_D3DKMT_SEGMENTSIZEINFO}; D3DKMT_SEGMENTSIZEINFO = _D3DKMT_SEGMENTSIZEINFO; {/// The D3DKMT_FLIPINFOFLAGS structure identifies flipping capabilities of the display miniport driver. } _D3DKMT_FLIPINFOFLAGS = record FLIPINTERVAL: UINT32; end; D3DKMT_FLIPINFOFLAGS = _D3DKMT_FLIPINFOFLAGS; {/// The D3DKMT_FLIPQUEUEINFO structure describes information about the graphics adapter's queue of flip operations. } _D3DKMT_FLIPQUEUEINFO = record MaxHardwareFlipQueueLength: UINT32; MaxSoftwareFlipQueueLength: UINT32; FlipFlags: D3DKMT_FLIPINFOFLAGS; end {_D3DKMT_FLIPQUEUEINFO}; D3DKMT_FLIPQUEUEINFO = _D3DKMT_FLIPQUEUEINFO; {/// The D3DKMT_ADAPTERADDRESS structure describes the physical location of the graphics adapter. } _D3DKMT_ADAPTERADDRESS = record BusNumber: UINT32; DeviceNumber: UINT32; FunctionNumber: UINT32; end {_D3DKMT_ADAPTERADDRESS}; D3DKMT_ADAPTERADDRESS = _D3DKMT_ADAPTERADDRESS; _D3DKMT_WORKINGSETFLAGS = record USEDEFAULT: UINT32; end {_D3DKMT_WORKINGSETFLAGS}; D3DKMT_WORKINGSETFLAGS = _D3DKMT_WORKINGSETFLAGS; {/// The D3DKMT_WORKINGSETINFO structure describes information about the graphics adapter's working set. } _D3DKMT_WORKINGSETINFO = record Flags: D3DKMT_WORKINGSETFLAGS; MinimumWorkingSetPercentile: ULONG; MaximumWorkingSetPercentile: ULONG; end {_D3DKMT_WORKINGSETINFO}; D3DKMT_WORKINGSETINFO = _D3DKMT_WORKINGSETINFO; {/// Indicates the version number of the user-mode driver. } _D3DKMT_UMD_DRIVER_VERSION = record DriverVersion: LARGE_INTEGER; end {_D3DKMT_UMD_DRIVER_VERSION}; D3DKMT_UMD_DRIVER_VERSION = _D3DKMT_UMD_DRIVER_VERSION; {/// Indicates whether the user-mode driver supports Direct Flip operations, in which video memory is seamlessly flipped between an application's managed primary allocations and the Desktop Window Manager (DWM) managed primary allocations. } _D3DKMT_DIRECTFLIP_SUPPORT = record Supported: Bool; end {_D3DKMT_DIRECTFLIP_SUPPORT}; D3DKMT_DIRECTFLIP_SUPPORT = _D3DKMT_DIRECTFLIP_SUPPORT; _D3DKMT_MULTIPLANEOVERLAY_SUPPORT = record Supported: Bool; end {_D3DKMT_MULTIPLANEOVERLAY_SUPPORT}; D3DKMT_MULTIPLANEOVERLAY_SUPPORT = _D3DKMT_MULTIPLANEOVERLAY_SUPPORT; _D3DKMT_DLIST_DRIVER_NAME = record DListFileName: array[0..MAX_PATH-1] of WCHAR; end {_D3DKMT_DLIST_DRIVER_NAME}; D3DKMT_DLIST_DRIVER_NAME = _D3DKMT_DLIST_DRIVER_NAME; const DXGK_MAX_METADATA_NAME_LENGTH = 32; type _DXGK_ENGINE_TYPE = ( DXGK_ENGINE_TYPE_OTHER = 0, // This value is used for proprietary or unique functionality that is not exposed by typical adapters, as well as for an engine that performs work that doesn't fall under another category. DXGK_ENGINE_TYPE_3D = 1, // The adapter's 3-D processing engine. All adapters that are not a display-only device have one 3-D engine. DXGK_ENGINE_TYPE_VIDEO_DECODE = 2, // The engine that handles video decoding, including decompression of video frames from an input stream into typical YUV surfaces. The workload packets for an H.264 video codec workload test must appear on either the decode engine or the 3-D engine. DXGK_ENGINE_TYPE_VIDEO_ENCODE = 3, // The engine that handles video encoding, including compression of typical video frames into an encoded video format. DXGK_ENGINE_TYPE_VIDEO_PROCESSING = 4, // The engine that is responsible for any video processing that is done after a video input stream is decoded. Such processing can include RGB surface conversion, filtering, stretching, color correction, deinterlacing, or other steps that are required before the final image is rendered to the display screen. The workload packets for workload tests must appear on either the video processing engine or the 3-D engine. DXGK_ENGINE_TYPE_SCENE_ASSEMBLY = 5, // The engine that performs vertex processing of 3-D workloads as a preliminary pass prior to the remainder of the 3-D rendering. This engine also stores vertices in bins that tile-based rendering engines use. DXGK_ENGINE_TYPE_COPY = 6, // The engine that is a copy engine used for moving data. This engine can perform subresource updates, blitting, paging, or other similar data handling. The workload packets for calls to CopySubresourceRegion or UpdateSubResource methods of Direct3D 10 and Direct3D 11 must appear on either the copy engine or the 3-D engine. DXGK_ENGINE_TYPE_OVERLAY = 7, // The virtual engine that is used for synchronized flipping of overlays in Direct3D 9. DXGK_ENGINE_TYPE_CRYPTO, DXGK_ENGINE_TYPE_MAX ); DXGK_ENGINE_TYPE = _DXGK_ENGINE_TYPE; _DXGK_NODEMETADATA_FLAGS = record Value: UINT32; end; DXGK_NODEMETADATA_FLAGS = _DXGK_NODEMETADATA_FLAGS; _DXGK_NODEMETADATA = record EngineType: DXGK_ENGINE_TYPE; FriendlyName: array[0..DXGK_MAX_METADATA_NAME_LENGTH-1] of WCHAR; Flags: DXGK_NODEMETADATA_FLAGS; GpuMmuSupported: BOOLEAN; IoMmuSupported: BOOLEAN; end; DXGK_NODEMETADATA = _DXGK_NODEMETADATA; DXGKARG_GETNODEMETADATA = DXGK_NODEMETADATA; _D3DKMT_NODEMETADATA = packed record NodeOrdinalAndAdapterIndex: INT32; NodeData: DXGK_NODEMETADATA; end ; D3DKMT_NODEMETADATA = _D3DKMT_NODEMETADATA; _D3DKMT_CPDRIVERNAME = record ContentProtectionFileName: array[0..MAX_PATH-1] of WCHAR; end {_D3DKMT_CPDRIVERNAME}; D3DKMT_CPDRIVERNAME = _D3DKMT_CPDRIVERNAME; _D3DKMT_XBOX = record IsXBOX: Bool; end {_D3DKMT_XBOX}; D3DKMT_XBOX = _D3DKMT_XBOX; _D3DKMT_INDEPENDENTFLIP_SUPPORT = record Supported: Bool; end {_D3DKMT_INDEPENDENTFLIP_SUPPORT}; D3DKMT_INDEPENDENTFLIP_SUPPORT = _D3DKMT_INDEPENDENTFLIP_SUPPORT; _D3DKMT_MIRACASTCOMPANIONDRIVERNAME = record MiracastCompanionDriverName: array[0..MAX_PATH-1] of WCHAR; end {_D3DKMT_MIRACASTCOMPANIONDRIVERNAME}; D3DKMT_MIRACASTCOMPANIONDRIVERNAME = _D3DKMT_MIRACASTCOMPANIONDRIVERNAME; _D3DKMT_PHYSICAL_ADAPTER_COUNT = record Count: UINT32; end; D3DKMT_PHYSICAL_ADAPTER_COUNT = _D3DKMT_PHYSICAL_ADAPTER_COUNT; _D3DKMT_DEVICE_IDS = record VendorID: UINT32; DeviceID: UINT32; SubVendorID: UINT32; SubSystemID: UINT32; RevisionID: UINT32; BusType: UINT32; end; D3DKMT_DEVICE_IDS = _D3DKMT_DEVICE_IDS; _D3DKMT_QUERY_DEVICE_IDS = record PhysicalAdapterIndex: UINT32; DeviceIds: D3DKMT_DEVICE_IDS; end; D3DKMT_QUERY_DEVICE_IDS = _D3DKMT_QUERY_DEVICE_IDS; _D3DKMT_DRIVERCAPS_EXT = record Value: UINT32; end; D3DKMT_DRIVERCAPS_EXT = _D3DKMT_DRIVERCAPS_EXT; _D3DKMT_MIRACAST_DRIVER_TYPE = ( D3DKMT_MIRACAST_DRIVER_NOT_SUPPORTED = 0, D3DKMT_MIRACAST_DRIVER_IHV = 1, D3DKMT_MIRACAST_DRIVER_MS = 2 ); D3DKMT_MIRACAST_DRIVER_TYPE = _D3DKMT_MIRACAST_DRIVER_TYPE; _D3DKMT_QUERY_MIRACAST_DRIVER_TYPE = record MiracastDriverType: D3DKMT_MIRACAST_DRIVER_TYPE; end {_D3DKMT_QUERY_MIRACAST_DRIVER_TYPE}; D3DKMT_QUERY_MIRACAST_DRIVER_TYPE = _D3DKMT_QUERY_MIRACAST_DRIVER_TYPE; _D3DKMT_GPUMMU_CAPS = record Caps: UINT32; end {_D3DKMT_GPUMMU_CAPS}; D3DKMT_GPUMMU_CAPS = _D3DKMT_GPUMMU_CAPS; _D3DKMT_QUERY_GPUMMU_CAPS = record PhysicalAdapterIndex: UINT32; Caps: D3DKMT_GPUMMU_CAPS; end {_D3DKMT_QUERY_GPUMMU_CAPS}; D3DKMT_QUERY_GPUMMU_CAPS = _D3DKMT_QUERY_GPUMMU_CAPS; _D3DKMT_MULTIPLANEOVERLAY_DECODE_SUPPORT = record Supported: Bool; end {_D3DKMT_MULTIPLANEOVERLAY_DECODE_SUPPORT}; D3DKMT_MULTIPLANEOVERLAY_DECODE_SUPPORT = _D3DKMT_MULTIPLANEOVERLAY_DECODE_SUPPORT; _D3DKMT_ISBADDRIVERFORHWPROTECTIONDISABLED = record Disabled: Bool; end {_D3DKMT_ISBADDRIVERFORHWPROTECTIONDISABLED}; D3DKMT_ISBADDRIVERFORHWPROTECTIONDISABLED = _D3DKMT_ISBADDRIVERFORHWPROTECTIONDISABLED; _D3DKMT_MULTIPLANEOVERLAY_SECONDARY_SUPPORT = record Supported: Bool; end {_D3DKMT_MULTIPLANEOVERLAY_SECONDARY_SUPPORT}; D3DKMT_MULTIPLANEOVERLAY_SECONDARY_SUPPORT = _D3DKMT_MULTIPLANEOVERLAY_SECONDARY_SUPPORT; _D3DKMT_INDEPENDENTFLIP_SECONDARY_SUPPORT = record Supported: Bool; end {_D3DKMT_INDEPENDENTFLIP_SECONDARY_SUPPORT}; D3DKMT_INDEPENDENTFLIP_SECONDARY_SUPPORT = _D3DKMT_INDEPENDENTFLIP_SECONDARY_SUPPORT; _D3DKMT_PANELFITTER_SUPPORT = record Supported: Bool; end {_D3DKMT_PANELFITTER_SUPPORT}; D3DKMT_PANELFITTER_SUPPORT = _D3DKMT_PANELFITTER_SUPPORT; _D3DKMT_PNP_KEY_TYPE = ( D3DKMT_PNP_KEY_HARDWARE {= 1}, D3DKMT_PNP_KEY_SOFTWARE {= 2 } ); {/// A structure that holds information about the segment group size. } _D3DKMT_SEGMENTGROUPSIZEINFO = record PhysicalAdapterIndex: UINT32; LegacyInfo: D3DKMT_SEGMENTSIZEINFO; LocalMemory: ULONGLONG; NonLocalMemory: ULONGLONG; NonBudgetMemory: ULONGLONG; end {_D3DKMT_SEGMENTGROUPSIZEINFO}; D3DKMT_SEGMENTGROUPSIZEINFO = _D3DKMT_SEGMENTGROUPSIZEINFO; {/// A structure that holds the support status. } _D3DKMT_MPO3DDI_SUPPORT = record Supported: Bool; end {_D3DKMT_MPO3DDI_SUPPORT}; D3DKMT_MPO3DDI_SUPPORT = _D3DKMT_MPO3DDI_SUPPORT; _D3DKMT_HWDRM_SUPPORT = record Supported: BOOLEAN; end {_D3DKMT_HWDRM_SUPPORT}; D3DKMT_HWDRM_SUPPORT = _D3DKMT_HWDRM_SUPPORT; _D3DKMT_MPOKERNELCAPS_SUPPORT = record Supported: Bool; end {_D3DKMT_MPOKERNELCAPS_SUPPORT}; D3DKMT_MPOKERNELCAPS_SUPPORT = _D3DKMT_MPOKERNELCAPS_SUPPORT; _D3DKMT_MULTIPLANEOVERLAY_STRETCH_SUPPORT = record VidPnSourceId: UINT32; Update: Bool; Supported: Bool; end {_D3DKMT_MULTIPLANEOVERLAY_STRETCH_SUPPORT}; D3DKMT_MULTIPLANEOVERLAY_STRETCH_SUPPORT = _D3DKMT_MULTIPLANEOVERLAY_STRETCH_SUPPORT; _D3DKMT_GET_DEVICE_VIDPN_OWNERSHIP_INFO = record hDevice: D3DKMT_HANDLE; bFailedDwmAcquireVidPn: BOOLEAN; end {_D3DKMT_GET_DEVICE_VIDPN_OWNERSHIP_INFO}; D3DKMT_GET_DEVICE_VIDPN_OWNERSHIP_INFO = _D3DKMT_GET_DEVICE_VIDPN_OWNERSHIP_INFO; _D3DDDI_QUERYREGISTRY_FLAGS = record Value: UINT32 end; D3DDDI_QUERYREGISTRY_FLAGS = _D3DDDI_QUERYREGISTRY_FLAGS; _D3DDDI_QUERYREGISTRY_TYPE = ( D3DDDI_QUERYREGISTRY_SERVICEKEY {= 0}, D3DDDI_QUERYREGISTRY_ADAPTERKEY {= 1}, D3DDDI_QUERYREGISTRY_DRIVERSTOREPATH {= 2}, D3DDDI_QUERYREGISTRY_DRIVERIMAGEPATH {= 3}, D3DDDI_QUERYREGISTRY_MAX ); D3DDDI_QUERYREGISTRY_TYPE = _D3DDDI_QUERYREGISTRY_TYPE; _D3DDDI_QUERYREGISTRY_STATUS = ( D3DDDI_QUERYREGISTRY_STATUS_SUCCESS {= 0}, D3DDDI_QUERYREGISTRY_STATUS_BUFFER_OVERFLOW {= 1}, D3DDDI_QUERYREGISTRY_STATUS_FAIL {= 2}, D3DDDI_QUERYREGISTRY_STATUS_MAX ); D3DDDI_QUERYREGISTRY_STATUS = _D3DDDI_QUERYREGISTRY_STATUS; {/// Contains information about the query registry. } {/// PrivateDriverSize must be sizeof(D3DDDI_QUERYREGISTRY_INFO) + (size of the the key value in bytes) } _D3DDDI_QUERYREGISTRY_INFO = record QueryType: D3DDDI_QUERYREGISTRY_TYPE; QueryFlags: D3DDDI_QUERYREGISTRY_FLAGS; ValueName: array[0..MAX_PATH-1] of WCHAR; ValueType: ULONG; PhysicalAdapterIndex: ULONG; OutputValueSize: ULONG; Status: D3DDDI_QUERYREGISTRY_STATUS; OutputDword: ULONG; OutputQword: UINT64; OutputString: array[0..0] of WCHAR; OutputBinary: array[0..0] of BYTE; end; {/// Contains the kernel mode driver version. } _D3DKMT_KMD_DRIVER_VERSION = record DriverVersion: LARGE_INTEGER; end {_D3DKMT_KMD_DRIVER_VERSION}; D3DKMT_KMD_DRIVER_VERSION = _D3DKMT_KMD_DRIVER_VERSION; _D3DKMT_BLOCKLIST_INFO = record Size: UINT32; BlockList: array[0..1-1] of WCHAR; end {_D3DKMT_BLOCKLIST_INFO}; D3DKMT_BLOCKLIST_INFO = _D3DKMT_BLOCKLIST_INFO; {/// Used to query for a unique guid. } _D3DKMT_QUERY_ADAPTER_UNIQUE_GUID = record AdapterUniqueGUID: array[0..40-1] of WCHAR; end {_D3DKMT_QUERY_ADAPTER_UNIQUE_GUID}; D3DKMT_QUERY_ADAPTER_UNIQUE_GUID = _D3DKMT_QUERY_ADAPTER_UNIQUE_GUID; {/// Represents performance data collected per engine from an adapter on an interval basis. } _D3DKMT_NODE_PERFDATA = record NodeOrdinal: UINT32; PhysicalAdapterIndex: UINT32; Frequency: ULONGLONG; MaxFrequency: ULONGLONG; MaxFrequencyOC: ULONGLONG; Voltage: ULONG; VoltageMax: ULONG; VoltageMaxOC: ULONG; MaxTransitionLatency: ULONGLONG; end {_D3DKMT_NODE_PERFDATA}; D3DKMT_NODE_PERFDATA = _D3DKMT_NODE_PERFDATA; {/// Represents performance data collected per adapter on an interval basis. } _D3DKMT_ADAPTER_PERFDATA = record PhysicalAdapterIndex: UINT32; MemoryFrequency: ULONGLONG; MaxMemoryFrequency: ULONGLONG; MaxMemoryFrequencyOC: ULONGLONG; MemoryBandwidth: ULONGLONG; PCIEBandwidth: ULONGLONG; FanRPM: ULONG; Power: ULONG; Temperature: ULONG; PowerStateOverride: UCHAR; end {_D3DKMT_ADAPTER_PERFDATA}; D3DKMT_ADAPTER_PERFDATA = _D3DKMT_ADAPTER_PERFDATA; {/// Represents data capabilities that are static and queried once per GPU during initialization. } _D3DKMT_ADAPTER_PERFDATACAPS = record PhysicalAdapterIndex: UINT32; MaxMemoryBandwidth: ULONGLONG; MaxPCIEBandwidth: ULONGLONG; MaxFanRPM: ULONG; TemperatureMax: ULONG; TemperatureWarning: ULONG; end {_D3DKMT_ADAPTER_PERFDATACAPS}; D3DKMT_ADAPTER_PERFDATACAPS = _D3DKMT_ADAPTER_PERFDATACAPS; const DXGK_MAX_GPUVERSION_NAME_LENGTH = 32; {/// Used to collect the bios version and gpu architecture name once during GPU initialization. } type _D3DKMT_GPUVERSION = record PhysicalAdapterIndex: UINT32; BiosVersion: array[0..DXGK_MAX_GPUVERSION_NAME_LENGTH-1] of WCHAR; GpuArchitecture: array[0..DXGK_MAX_GPUVERSION_NAME_LENGTH-1] of WCHAR; end {_D3DKMT_GPUVERSION}; D3DKMT_GPUVERSION = _D3DKMT_GPUVERSION; {/// Describes the kernel mode display driver. } _D3DKMT_DRIVER_DESCRIPTION = record DriverDescription: array[0..4096-1] of WCHAR; end {_D3DKMT_DRIVER_DESCRIPTION}; D3DKMT_DRIVER_DESCRIPTION = _D3DKMT_DRIVER_DESCRIPTION; _D3DKMT_QUERY_SCANOUT_CAPS = record VidPnSourceId: ULONG; Caps: Word; end {_D3DKMT_QUERY_SCANOUT_CAPS}; D3DKMT_QUERY_SCANOUT_CAPS = _D3DKMT_QUERY_SCANOUT_CAPS; {/// Describes the mapping of the given name of a GDI device to a graphics adapter handle and monitor output. } _D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME = record DeviceName: array[0..32-1] of WCHAR; AdapterHandle: D3DKMT_HANDLE; AdapterLuid: LUID; VidPnSourceId: ULONG; end {_D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME}; D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME = _D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME; {/// Describes the mapping of a device context handle (HDC) to a graphics adapter handle and monitor output. } _D3DKMT_OPENADAPTERFROMHDC = record hDc: HDC; AdapterHandle: D3DKMT_HANDLE; AdapterLuid: LUID; VidPnSourceId: ULONG; end {_D3DKMT_OPENADAPTERFROMHDC}; D3DKMT_OPENADAPTERFROMHDC = _D3DKMT_OPENADAPTERFROMHDC; {/// Supplies configuration information about a graphics adapter. } _D3DKMT_ADAPTERINFO = record AdapterHandle: D3DKMT_HANDLE; AdapterLuid: LUID; NumOfSources: ULONG; bPresentMoveRegionsPreferred: Bool; end {_D3DKMT_ADAPTERINFO}; D3DKMT_ADAPTERINFO = _D3DKMT_ADAPTERINFO; const MAX_ENUM_ADAPTERS = 16; {/// Supplies information for enumerating all graphics adapters on the system. } type _D3DKMT_ENUMADAPTERS = record NumAdapters: ULONG; Adapters: array[0..MAX_ENUM_ADAPTERS-1] of D3DKMT_ADAPTERINFO; end {_D3DKMT_ENUMADAPTERS}; D3DKMT_ENUMADAPTERS = _D3DKMT_ENUMADAPTERS; _D3DKMT_QUERYRESULT_PREEMPTION_ATTEMPT_RESULT = ( D3DKMT_PreemptionAttempt = 0, D3DKMT_PreemptionAttemptSuccess = 1, D3DKMT_PreemptionAttemptMissNoCommand = 2, D3DKMT_PreemptionAttemptMissNotEnabled = 3, D3DKMT_PreemptionAttemptMissNextFence = 4, D3DKMT_PreemptionAttemptMissPagingCommand = 5, D3DKMT_PreemptionAttemptMissSplittedCommand = 6, D3DKMT_PreemptionAttemptMissFenceCommand= 7, D3DKMT_PreemptionAttemptMissRenderPendingFlip = 8, D3DKMT_PreemptionAttemptMissNotMakingProgress = 9, D3DKMT_PreemptionAttemptMissLessPriority = 10, D3DKMT_PreemptionAttemptMissRemainingQuantum = 11, D3DKMT_PreemptionAttemptMissRemainingPreemptionQuantum = 12, D3DKMT_PreemptionAttemptMissAlreadyPreempting = 13, D3DKMT_PreemptionAttemptMissGlobalBlock = 14, D3DKMT_PreemptionAttemptMissAlreadyRunning = 15, D3DKMT_PreemptionAttemptStatisticsMax ); D3DKMT_QUERYRESULT_PREEMPTION_ATTEMPT_RESULT = _D3DKMT_QUERYRESULT_PREEMPTION_ATTEMPT_RESULT; _D3DKMT_QUERYSTATISTICS_DMA_PACKET_TYPE = ( D3DKMT_ClientRenderBuffer = 0, D3DKMT_ClientPagingBuffer = 1, D3DKMT_SystemPagingBuffer = 2, D3DKMT_SystemPreemptionBuffer = 3, D3DKMT_DmaPacketTypeMax ); D3DKMT_QUERYSTATISTICS_DMA_PACKET_TYPE = _D3DKMT_QUERYSTATISTICS_DMA_PACKET_TYPE; _D3DKMT_QUERYSTATISTICS_QUEUE_PACKET_TYPE = ( D3DKMT_RenderCommandBuffer = 0, D3DKMT_DeferredCommandBuffer = 1, D3DKMT_SystemCommandBuffer = 2, D3DKMT_MmIoFlipCommandBuffer = 3, D3DKMT_WaitCommandBuffer = 4, D3DKMT_SignalCommandBuffer = 5, D3DKMT_DeviceCommandBuffer = 6, D3DKMT_SoftwareCommandBuffer = 7, D3DKMT_QueuePacketTypeMax ); D3DKMT_QUERYSTATISTICS_QUEUE_PACKET_TYPE = _D3DKMT_QUERYSTATISTICS_QUEUE_PACKET_TYPE; _D3DKMT_QUERYSTATISTICS_ALLOCATION_PRIORITY_CLASS = ( D3DKMT_AllocationPriorityClassMinimum = 0, D3DKMT_AllocationPriorityClassLow = 1, D3DKMT_AllocationPriorityClassNormal = 2, D3DKMT_AllocationPriorityClassHigh = 3, D3DKMT_AllocationPriorityClassMaximum = 4, D3DKMT_MaxAllocationPriorityClass ); D3DKMT_QUERYSTATISTICS_ALLOCATION_PRIORITY_CLASS = _D3DKMT_QUERYSTATISTICS_ALLOCATION_PRIORITY_CLASS; const D3DKMT_QUERYSTATISTICS_SEGMENT_PREFERENCE_MAX = 5; type _D3DKMT_QUERYSTATISTICS_COUNTER = record Count: ULONG; Bytes: ULONGLONG; end {_D3DKMT_QUERYSTATISTICS_COUNTER}; D3DKMT_QUERYSTATISTICS_COUNTER = _D3DKMT_QUERYSTATISTICS_COUNTER; _D3DKMT_QUERYSTATISTICS_DMA_PACKET_TYPE_INFORMATION = record PacketSubmited: ULONG; PacketCompleted: ULONG; PacketPreempted: ULONG; PacketFaulted: ULONG; end {_D3DKMT_QUERYSTATISTICS_DMA_PACKET_TYPE_INFORMATION}; D3DKMT_QUERYSTATISTICS_DMA_PACKET_TYPE_INFORMATION = _D3DKMT_QUERYSTATISTICS_DMA_PACKET_TYPE_INFORMATION; _D3DKMT_QUERYSTATISTICS_QUEUE_PACKET_TYPE_INFORMATION = record PacketSubmited: ULONG; PacketCompleted: ULONG; end {_D3DKMT_QUERYSTATISTICS_QUEUE_PACKET_TYPE_INFORMATION}; D3DKMT_QUERYSTATISTICS_QUEUE_PACKET_TYPE_INFORMATION = _D3DKMT_QUERYSTATISTICS_QUEUE_PACKET_TYPE_INFORMATION; _D3DKMT_QUERYSTATISTICS_PACKET_INFORMATION = record QueuePacket: array[0..Ord(D3DKMT_QueuePacketTypeMax)-1] of D3DKMT_QUERYSTATISTICS_QUEUE_PACKET_TYPE_INFORMATION; DmaPacket: array[0..Ord(D3DKMT_DmaPacketTypeMax)-1] of D3DKMT_QUERYSTATISTICS_DMA_PACKET_TYPE_INFORMATION; end {_D3DKMT_QUERYSTATISTICS_PACKET_INFORMATION}; D3DKMT_QUERYSTATISTICS_PACKET_INFORMATION = _D3DKMT_QUERYSTATISTICS_PACKET_INFORMATION; _D3DKMT_QUERYSTATISTICS_PREEMPTION_INFORMATION = record PreemptionCounter: array[0..Ord(D3DKMT_PreemptionAttemptStatisticsMax)-1] of ULONG; end {_D3DKMT_QUERYSTATISTICS_PREEMPTION_INFORMATION}; D3DKMT_QUERYSTATISTICS_PREEMPTION_INFORMATION = _D3DKMT_QUERYSTATISTICS_PREEMPTION_INFORMATION; _D3DKMT_QUERYSTATISTICS_PROCESS_NODE_INFORMATION = record RunningTime: LARGE_INTEGER; ContextSwitch: ULONG; PreemptionStatistics: D3DKMT_QUERYSTATISTICS_PREEMPTION_INFORMATION; PacketStatistics: D3DKMT_QUERYSTATISTICS_PACKET_INFORMATION; Reserved: array[0..8-1] of ULONG64; end {_D3DKMT_QUERYSTATISTICS_PROCESS_NODE_INFORMATION}; D3DKMT_QUERYSTATISTICS_PROCESS_NODE_INFORMATION = _D3DKMT_QUERYSTATISTICS_PROCESS_NODE_INFORMATION; _D3DKMT_QUERYSTATISTICS_NODE_INFORMATION = record GlobalInformation: D3DKMT_QUERYSTATISTICS_PROCESS_NODE_INFORMATION; SystemInformation: D3DKMT_QUERYSTATISTICS_PROCESS_NODE_INFORMATION; {///ULONG NodeId; // Win10 } Reserved: array[0..8-1] of ULONG64; end {_D3DKMT_QUERYSTATISTICS_NODE_INFORMATION}; D3DKMT_QUERYSTATISTICS_NODE_INFORMATION = _D3DKMT_QUERYSTATISTICS_NODE_INFORMATION; _D3DKMT_QUERYSTATISTICS_PROCESS_VIDPNSOURCE_INFORMATION = record Frame: ULONG; CancelledFrame: ULONG; QueuedPresent: ULONG; Reserved: array[0..8-1] of ULONG64; end {_D3DKMT_QUERYSTATISTICS_PROCESS_VIDPNSOURCE_INFORMATION}; D3DKMT_QUERYSTATISTICS_PROCESS_VIDPNSOURCE_INFORMATION = _D3DKMT_QUERYSTATISTICS_PROCESS_VIDPNSOURCE_INFORMATION; _D3DKMT_QUERYSTATISTICS_VIDPNSOURCE_INFORMATION = record GlobalInformation: D3DKMT_QUERYSTATISTICS_PROCESS_VIDPNSOURCE_INFORMATION; SystemInformation: D3DKMT_QUERYSTATISTICS_PROCESS_VIDPNSOURCE_INFORMATION; Reserved: array[0..8-1] of ULONG64; end {_D3DKMT_QUERYSTATISTICS_VIDPNSOURCE_INFORMATION}; D3DKMT_QUERYSTATISTICS_VIDPNSOURCE_INFORMATION = _D3DKMT_QUERYSTATISTICS_VIDPNSOURCE_INFORMATION; _D3DKMT_QUERYSTATSTICS_REFERENCE_DMA_BUFFER = record NbCall: ULONG; NbAllocationsReferenced: ULONG; MaxNbAllocationsReferenced: ULONG; NbNULLReference: ULONG; NbWriteReference: ULONG; NbRenamedAllocationsReferenced: ULONG; NbIterationSearchingRenamedAllocation: ULONG; NbLockedAllocationReferenced: ULONG; NbAllocationWithValidPrepatchingInfoReferenced: ULONG; NbAllocationWithInvalidPrepatchingInfoReferenced: ULONG; NbDMABufferSuccessfullyPrePatched: ULONG; NbPrimariesReferencesOverflow: ULONG; NbAllocationWithNonPreferredResources: ULONG; NbAllocationInsertedInMigrationTable: ULONG; end {_D3DKMT_QUERYSTATSTICS_REFERENCE_DMA_BUFFER}; D3DKMT_QUERYSTATSTICS_REFERENCE_DMA_BUFFER = _D3DKMT_QUERYSTATSTICS_REFERENCE_DMA_BUFFER; _D3DKMT_QUERYSTATSTICS_RENAMING = record NbAllocationsRenamed: ULONG; NbAllocationsShrinked: ULONG; NbRenamedBuffer: ULONG; MaxRenamingListLength: ULONG; NbFailuresDueToRenamingLimit: ULONG; NbFailuresDueToCreateAllocation: ULONG; NbFailuresDueToOpenAllocation: ULONG; NbFailuresDueToLowResource: ULONG; NbFailuresDueToNonRetiredLimit: ULONG; end {_D3DKMT_QUERYSTATSTICS_RENAMING}; D3DKMT_QUERYSTATSTICS_RENAMING = _D3DKMT_QUERYSTATSTICS_RENAMING; _D3DKMT_QUERYSTATSTICS_PREPRATION = record BroadcastStall: ULONG; NbDMAPrepared: ULONG; NbDMAPreparedLongPath: ULONG; ImmediateHighestPreparationPass: ULONG; AllocationsTrimmed: D3DKMT_QUERYSTATISTICS_COUNTER; end {_D3DKMT_QUERYSTATSTICS_PREPRATION}; D3DKMT_QUERYSTATSTICS_PREPRATION = _D3DKMT_QUERYSTATSTICS_PREPRATION; _D3DKMT_QUERYSTATSTICS_PAGING_FAULT = record Faults: D3DKMT_QUERYSTATISTICS_COUNTER; FaultsFirstTimeAccess: D3DKMT_QUERYSTATISTICS_COUNTER; FaultsReclaimed: D3DKMT_QUERYSTATISTICS_COUNTER; FaultsMigration: D3DKMT_QUERYSTATISTICS_COUNTER; FaultsIncorrectResource: D3DKMT_QUERYSTATISTICS_COUNTER; FaultsLostContent: D3DKMT_QUERYSTATISTICS_COUNTER; FaultsEvicted: D3DKMT_QUERYSTATISTICS_COUNTER; AllocationsMEM_RESET: D3DKMT_QUERYSTATISTICS_COUNTER; AllocationsUnresetSuccess: D3DKMT_QUERYSTATISTICS_COUNTER; AllocationsUnresetFail: D3DKMT_QUERYSTATISTICS_COUNTER; AllocationsUnresetSuccessRead: ULONG; AllocationsUnresetFailRead: ULONG; Evictions: D3DKMT_QUERYSTATISTICS_COUNTER; EvictionsDueToPreparation: D3DKMT_QUERYSTATISTICS_COUNTER; EvictionsDueToLock: D3DKMT_QUERYSTATISTICS_COUNTER; EvictionsDueToClose: D3DKMT_QUERYSTATISTICS_COUNTER; EvictionsDueToPurge: D3DKMT_QUERYSTATISTICS_COUNTER; EvictionsDueToSuspendCPUAccess: D3DKMT_QUERYSTATISTICS_COUNTER; end {_D3DKMT_QUERYSTATSTICS_PAGING_FAULT}; D3DKMT_QUERYSTATSTICS_PAGING_FAULT = _D3DKMT_QUERYSTATSTICS_PAGING_FAULT; _D3DKMT_QUERYSTATSTICS_PAGING_TRANSFER = record BytesFilled: ULONGLONG; BytesDiscarded: ULONGLONG; BytesMappedIntoAperture: ULONGLONG; BytesUnmappedFromAperture: ULONGLONG; BytesTransferredFromMdlToMemory: ULONGLONG; BytesTransferredFromMemoryToMdl: ULONGLONG; BytesTransferredFromApertureToMemory: ULONGLONG; BytesTransferredFromMemoryToAperture: ULONGLONG; end {_D3DKMT_QUERYSTATSTICS_PAGING_TRANSFER}; D3DKMT_QUERYSTATSTICS_PAGING_TRANSFER = _D3DKMT_QUERYSTATSTICS_PAGING_TRANSFER; _D3DKMT_QUERYSTATSTICS_SWIZZLING_RANGE = record NbRangesAcquired: ULONG; NbRangesReleased: ULONG; end {_D3DKMT_QUERYSTATSTICS_SWIZZLING_RANGE}; D3DKMT_QUERYSTATSTICS_SWIZZLING_RANGE = _D3DKMT_QUERYSTATSTICS_SWIZZLING_RANGE; _D3DKMT_QUERYSTATSTICS_LOCKS = record NbLocks: ULONG; NbLocksWaitFlag: ULONG; NbLocksDiscardFlag: ULONG; NbLocksNoOverwrite: ULONG; NbLocksNoReadSync: ULONG; NbLocksLinearization: ULONG; NbComplexLocks: ULONG; end {_D3DKMT_QUERYSTATSTICS_LOCKS}; D3DKMT_QUERYSTATSTICS_LOCKS = _D3DKMT_QUERYSTATSTICS_LOCKS; _D3DKMT_QUERYSTATSTICS_ALLOCATIONS = record Created: D3DKMT_QUERYSTATISTICS_COUNTER; Destroyed: D3DKMT_QUERYSTATISTICS_COUNTER; Opened: D3DKMT_QUERYSTATISTICS_COUNTER; Closed: D3DKMT_QUERYSTATISTICS_COUNTER; MigratedSuccess: D3DKMT_QUERYSTATISTICS_COUNTER; MigratedFail: D3DKMT_QUERYSTATISTICS_COUNTER; MigratedAbandoned: D3DKMT_QUERYSTATISTICS_COUNTER; end {_D3DKMT_QUERYSTATSTICS_ALLOCATIONS}; D3DKMT_QUERYSTATSTICS_ALLOCATIONS = _D3DKMT_QUERYSTATSTICS_ALLOCATIONS; _D3DKMT_QUERYSTATSTICS_TERMINATIONS = record TerminatedShared: D3DKMT_QUERYSTATISTICS_COUNTER; TerminatedNonShared: D3DKMT_QUERYSTATISTICS_COUNTER; DestroyedShared: D3DKMT_QUERYSTATISTICS_COUNTER; DestroyedNonShared: D3DKMT_QUERYSTATISTICS_COUNTER; end {_D3DKMT_QUERYSTATSTICS_TERMINATIONS}; D3DKMT_QUERYSTATSTICS_TERMINATIONS = _D3DKMT_QUERYSTATSTICS_TERMINATIONS; _D3DKMT_QUERYSTATISTICS_ADAPTER_INFORMATION = record NbSegments: ULONG; NodeCount: ULONG; VidPnSourceCount: ULONG; VSyncEnabled: ULONG; TdrDetectedCount: ULONG; ZeroLengthDmaBuffers: LONGLONG; RestartedPeriod: ULONGLONG; ReferenceDmaBuffer: D3DKMT_QUERYSTATSTICS_REFERENCE_DMA_BUFFER; Renaming: D3DKMT_QUERYSTATSTICS_RENAMING; Preparation: D3DKMT_QUERYSTATSTICS_PREPRATION; PagingFault: D3DKMT_QUERYSTATSTICS_PAGING_FAULT; PagingTransfer: D3DKMT_QUERYSTATSTICS_PAGING_TRANSFER; SwizzlingRange: D3DKMT_QUERYSTATSTICS_SWIZZLING_RANGE; Locks: D3DKMT_QUERYSTATSTICS_LOCKS; Allocations: D3DKMT_QUERYSTATSTICS_ALLOCATIONS; Terminations: D3DKMT_QUERYSTATSTICS_TERMINATIONS; Reserved: array[0..8-1] of ULONG64; end {_D3DKMT_QUERYSTATISTICS_ADAPTER_INFORMATION}; D3DKMT_QUERYSTATISTICS_ADAPTER_INFORMATION = _D3DKMT_QUERYSTATISTICS_ADAPTER_INFORMATION; _D3DKMT_QUERYSTATISTICS_SYSTEM_MEMORY = record BytesAllocated: ULONGLONG; BytesReserved: ULONGLONG; SmallAllocationBlocks: ULONG; LargeAllocationBlocks: ULONG; WriteCombinedBytesAllocated: ULONGLONG; WriteCombinedBytesReserved: ULONGLONG; CachedBytesAllocated: ULONGLONG; CachedBytesReserved: ULONGLONG; SectionBytesAllocated: ULONGLONG; SectionBytesReserved: ULONGLONG; end {_D3DKMT_QUERYSTATISTICS_SYSTEM_MEMORY}; D3DKMT_QUERYSTATISTICS_SYSTEM_MEMORY = _D3DKMT_QUERYSTATISTICS_SYSTEM_MEMORY; _D3DKMT_QUERYSTATISTICS_PROCESS_INFORMATION = record NodeCount: ULONG; VidPnSourceCount: ULONG; SystemMemory: D3DKMT_QUERYSTATISTICS_SYSTEM_MEMORY; Reserved: array[0..8-1] of ULONG64; end {_D3DKMT_QUERYSTATISTICS_PROCESS_INFORMATION}; D3DKMT_QUERYSTATISTICS_PROCESS_INFORMATION = _D3DKMT_QUERYSTATISTICS_PROCESS_INFORMATION; _D3DKMT_QUERYSTATISTICS_DMA_BUFFER = record Size: D3DKMT_QUERYSTATISTICS_COUNTER; AllocationListBytes: ULONG; PatchLocationListBytes: ULONG; end {_D3DKMT_QUERYSTATISTICS_DMA_BUFFER}; D3DKMT_QUERYSTATISTICS_DMA_BUFFER = _D3DKMT_QUERYSTATISTICS_DMA_BUFFER; _D3DKMT_QUERYSTATISTICS_COMMITMENT_DATA = record TotalBytesEvictedFromProcess: ULONG64; BytesBySegmentPreference: array[0..D3DKMT_QUERYSTATISTICS_SEGMENT_PREFERENCE_MAX-1] of ULONG64; end {_D3DKMT_QUERYSTATISTICS_COMMITMENT_DATA}; D3DKMT_QUERYSTATISTICS_COMMITMENT_DATA = _D3DKMT_QUERYSTATISTICS_COMMITMENT_DATA; _D3DKMT_QUERYSTATISTICS_POLICY = record PreferApertureForRead: array[0..Ord(D3DKMT_MaxAllocationPriorityClass)-1] of ULONGLONG; PreferAperture: array[0..Ord(D3DKMT_MaxAllocationPriorityClass)-1] of ULONGLONG; MemResetOnPaging: ULONGLONG; RemovePagesFromWorkingSetOnPaging: ULONGLONG; MigrationEnabled: ULONGLONG; end {_D3DKMT_QUERYSTATISTICS_POLICY}; D3DKMT_QUERYSTATISTICS_POLICY = _D3DKMT_QUERYSTATISTICS_POLICY; _D3DKMT_QUERYSTATISTICS_PROCESS_ADAPTER_INFORMATION = record NbSegments: ULONG; NodeCount: ULONG; VidPnSourceCount: ULONG; VirtualMemoryUsage: ULONG; DmaBuffer: D3DKMT_QUERYSTATISTICS_DMA_BUFFER; CommitmentData: D3DKMT_QUERYSTATISTICS_COMMITMENT_DATA; _Policy: D3DKMT_QUERYSTATISTICS_POLICY; Reserved: array[0..7] of ULONG64; end {_D3DKMT_QUERYSTATISTICS_PROCESS_ADAPTER_INFORMATION}; D3DKMT_QUERYSTATISTICS_PROCESS_ADAPTER_INFORMATION = _D3DKMT_QUERYSTATISTICS_PROCESS_ADAPTER_INFORMATION; _D3DKMT_QUERYSTATISTICS_MEMORY = record TotalBytesEvicted: ULONGLONG; AllocsCommitted: ULONG; AllocsResident: ULONG; end {_D3DKMT_QUERYSTATISTICS_MEMORY}; D3DKMT_QUERYSTATISTICS_MEMORY = _D3DKMT_QUERYSTATISTICS_MEMORY; _D3DKMT_QUERYSTATISTICS_SEGMENT_INFORMATION_V1 = record CommitLimit: ULONG; BytesCommitted: ULONG; BytesResident: ULONG; Memory: D3DKMT_QUERYSTATISTICS_MEMORY; Aperture: ULONG; TotalBytesEvictedByPriority: array[0..Ord(D3DKMT_MaxAllocationPriorityClass)-1] of ULONGLONG; SystemMemoryEndAddress: ULONG64; PowerFlags: ULONG64; end {_D3DKMT_QUERYSTATISTICS_SEGMENT_INFORMATION_V1}; D3DKMT_QUERYSTATISTICS_SEGMENT_INFORMATION_V1 = _D3DKMT_QUERYSTATISTICS_SEGMENT_INFORMATION_V1; _D3DKMT_QUERYSTATISTICS_SEGMENT_INFORMATION = record CommitLimit: ULONGLONG; BytesCommitted: ULONGLONG; BytesResident: ULONGLONG; Memory: D3DKMT_QUERYSTATISTICS_MEMORY; Aperture: ULONG; TotalBytesEvictedByPriority: array[0..Ord(D3DKMT_MaxAllocationPriorityClass)-1] of ULONGLONG; SystemMemoryEndAddress: ULONG64; PowerFlags: ULONG64; end {_D3DKMT_QUERYSTATISTICS_SEGMENT_INFORMATION}; D3DKMT_QUERYSTATISTICS_SEGMENT_INFORMATION = _D3DKMT_QUERYSTATISTICS_SEGMENT_INFORMATION; _D3DKMT_QUERYSTATISTICS_VIDEO_MEMORY = record AllocsCommitted: ULONG; AllocsResidentInP: array[0..D3DKMT_QUERYSTATISTICS_SEGMENT_PREFERENCE_MAX-1] of D3DKMT_QUERYSTATISTICS_COUNTER; AllocsResidentInNonPreferred: D3DKMT_QUERYSTATISTICS_COUNTER; TotalBytesEvictedDueToPreparation: ULONGLONG; end {_D3DKMT_QUERYSTATISTICS_VIDEO_MEMORY}; D3DKMT_QUERYSTATISTICS_VIDEO_MEMORY = _D3DKMT_QUERYSTATISTICS_VIDEO_MEMORY; _D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_POLICY = record UseMRU: ULONGLONG; end {_D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_POLICY}; D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_POLICY = _D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_POLICY; _D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_INFORMATION = record BytesCommitted: ULONGLONG; MaximumWorkingSet: ULONGLONG; MinimumWorkingSet: ULONGLONG; NbReferencedAllocationEvictedInPeriod: ULONG; VideoMemory: D3DKMT_QUERYSTATISTICS_VIDEO_MEMORY; _Policy: D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_POLICY; Reserved: array[0..7] of ULONG64; end {_D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_INFORMATION}; D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_INFORMATION = _D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_INFORMATION; _D3DKMT_QUERYSTATISTICS_TYPE = ( D3DKMT_QUERYSTATISTICS_ADAPTER, D3DKMT_QUERYSTATISTICS_PROCESS, D3DKMT_QUERYSTATISTICS_PROCESS_ADAPTER, D3DKMT_QUERYSTATISTICS_SEGMENT, D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT, D3DKMT_QUERYSTATISTICS_NODE, D3DKMT_QUERYSTATISTICS_PROCESS_NODE, D3DKMT_QUERYSTATISTICS_VIDPNSOURCE, D3DKMT_QUERYSTATISTICS_PROCESS_VIDPNSOURCE, D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_GROUP, D3DKMT_QUERYSTATISTICS_PHYSICAL_ADAPTER ); D3DKMT_QUERYSTATISTICS_TYPE = _D3DKMT_QUERYSTATISTICS_TYPE; _D3DKMT_QUERYSTATISTICS_QUERY_SEGMENT = record SegmentId: ULONG; end; D3DKMT_QUERYSTATISTICS_QUERY_SEGMENT = _D3DKMT_QUERYSTATISTICS_QUERY_SEGMENT; _D3DKMT_QUERYSTATISTICS_QUERY_NODE = record NodeId: ULONG; end {_D3DKMT_QUERYSTATISTICS_QUERY_NODE}; D3DKMT_QUERYSTATISTICS_QUERY_NODE = _D3DKMT_QUERYSTATISTICS_QUERY_NODE; _D3DKMT_QUERYSTATISTICS_QUERY_VIDPNSOURCE = record VidPnSourceId: ULONG; end {_D3DKMT_QUERYSTATISTICS_QUERY_VIDPNSOURCE}; D3DKMT_QUERYSTATISTICS_QUERY_VIDPNSOURCE = _D3DKMT_QUERYSTATISTICS_QUERY_VIDPNSOURCE; _D3DKMT_QUERYSTATISTICS_RESULT = record case Word of 1: (AdapterInformation: D3DKMT_QUERYSTATISTICS_ADAPTER_INFORMATION;); // (PhysAdapterInformation: D3DKMT_QUERYSTATISTICS_PHYSICAL_ADAPTER_INFORMATION); 2: (SegmentInformationV1: D3DKMT_QUERYSTATISTICS_SEGMENT_INFORMATION_V1;); 3: (SegmentInformation: D3DKMT_QUERYSTATISTICS_SEGMENT_INFORMATION;); 4: (NodeInformation: D3DKMT_QUERYSTATISTICS_NODE_INFORMATION;); 5: (VidPnSourceInformation: D3DKMT_QUERYSTATISTICS_VIDPNSOURCE_INFORMATION;); 6: (ProcessInformation: D3DKMT_QUERYSTATISTICS_PROCESS_INFORMATION;); 7: (ProcessAdapterInformation: D3DKMT_QUERYSTATISTICS_PROCESS_ADAPTER_INFORMATION;); 8: (ProcessSegmentInformation: D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_INFORMATION;); 9: (ProcessNodeInformation: D3DKMT_QUERYSTATISTICS_PROCESS_NODE_INFORMATION;); 10: (ProcessVidPnSourceInformation: D3DKMT_QUERYSTATISTICS_PROCESS_VIDPNSOURCE_INFORMATION;); // ProcessSegmentGroupInformation D3DKMT_QUERYSTATISTICS_PROCESS_SEGMENT_GROUP_INFORMATION); end; D3DKMT_QUERYSTATISTICS_RESULT = _D3DKMT_QUERYSTATISTICS_RESULT; PD3DKMT_QUERYSTATISTICS_RESULT = ^D3DKMT_QUERYSTATISTICS_RESULT; _D3DKMT_QUERYSTATISTICS = record Typ: D3DKMT_QUERYSTATISTICS_TYPE; AdapterLuid: TLUID; ProcessHandle: THandle; QueryResult: D3DKMT_QUERYSTATISTICS_RESULT; QuerySegment: D3DKMT_QUERYSTATISTICS_QUERY_SEGMENT; QueryProcessSegment: D3DKMT_QUERYSTATISTICS_QUERY_SEGMENT; QueryNode: D3DKMT_QUERYSTATISTICS_QUERY_NODE; QueryProcessNode: D3DKMT_QUERYSTATISTICS_QUERY_NODE; QueryVidPnSource: D3DKMT_QUERYSTATISTICS_QUERY_VIDPNSOURCE; QueryProcessVidPnSource: D3DKMT_QUERYSTATISTICS_QUERY_VIDPNSOURCE; end; D3DKMT_QUERYSTATISTICS = _D3DKMT_QUERYSTATISTICS; PD3DKMT_QUERYSTATISTICS = ^D3DKMT_QUERYSTATISTICS; TD3DKMTOpenAdapterFromDeviceName = function(var Arg1: D3DKMT_OPENADAPTERFROMDEVICENAME): NTSTATUS; stdcall; TD3DKMTOpenAdapterFromLuid = function(var Arg1: D3DKMT_OPENADAPTERFROMLUID): NTSTATUS; stdcall; TD3DKMTQueryAdapterInfo = function(var Arg1: D3DKMT_QUERYADAPTERINFO): NTSTATUS; stdcall; TD3DKMTQueryStatistics = function(var pData: D3DKMT_QUERYSTATISTICS): NTSTATUS; stdcall; TD3DKMTCloseAdapter = function(var AdapterHandle: D3DKMT_HANDLE): NTSTATUS; stdcall; var D3DKMTOpenAdapterFromDeviceName: TD3DKMTOpenAdapterFromDeviceName = nil; D3DKMTOpenAdapterFromLuid: TD3DKMTOpenAdapterFromLuid = nil; D3DKMTQueryAdapterInfo: TD3DKMTQueryAdapterInfo = nil; D3DKMTQueryStatistics: TD3DKMTQueryStatistics = nil; D3DKMTCloseAdapter: TD3DKMTCloseAdapter = nil; implementation var GDI32Handle: THandle; initialization GDI32Handle:=GetModuleHandle(GDI32DLL); if GDI32Handle=0 then GDI32Handle:=LoadLibrary(GDI32DLL); if GDI32Handle<>0 then begin @D3DKMTOpenAdapterFromDeviceName:=GetProcAddress(GDI32Handle,'D3DKMTOpenAdapterFromDeviceName'); @D3DKMTOpenAdapterFromLuid:=GetProcAddress(GDI32Handle,'D3DKMTOpenAdapterFromLuid'); @D3DKMTQueryAdapterInfo:=GetProcAddress(GDI32Handle,'D3DKMTQueryAdapterInfo'); @D3DKMTQueryStatistics:=GetProcAddress(GDI32Handle,'D3DKMTQueryStatistics'); @D3DKMTCloseAdapter:=GetProcAddress(GDI32Handle,'D3DKMTCloseAdapter'); end; end.