// d3dukmdt.h
typedef struct _D3DDDI_QUERYREGISTRY_INFO {
D3DDDI_QUERYREGISTRY_TYPE QueryType;
D3DDDI_QUERYREGISTRY_FLAGS QueryFlags;
WCHAR ValueName[MAX_PATH];
ULONG ValueType;
ULONG PhysicalAdapterIndex;
ULONG OutputValueSize;
D3DDDI_QUERYREGISTRY_STATUS Status;
union {
DWORD OutputDword;
D3DKMT_ALIGN64 UINT64 OutputQword;
WCHAR OutputString[1];
BYTE OutputBinary[1];
};
} D3DDDI_QUERYREGISTRY_INFO;
View the official Windows Driver Kit DDI referenceNo description available.
The D3DDDI_QUERYREGISTRY_INFO structure indicates how D3DDDICB_QUERYADAPTERINFO2::pDriverPrivateData should be reinterpreted when D3DDDICB_QUERYADAPTERINFO2::QueryType is D3DDDI_QUERYADAPTERTYPE_QUERYREGISTRY.
QueryType[in] A D3DDDI_QUERYREGISTRY_TYPE value that indicates which data to retrieve.
D3DDDI_QUERYREGISTRY_INFO::QueryType is the most significant field of this structure. It indicates whether the registry or file paths are being retrieved, as well as which specific registry hive and file path.
Registry Key Enums:
File Path Enums:
QueryFlags[in] A D3DDDI_QUERYREGISTRY_FLAGS structure with flags that control how strings are retrieved. QueryFlags can do additional operations, like translate retrieved strings containing file paths to the guest environment.
ValueName[MAX_PATH][in] Zero-terminated UNICODE string that can contain a sub-key name, which is separated from the actual value name by backslash. For example, ValueName could be SubKey1\ SubKey2\NameOfTheValue. In this case, SubKey1\ SubKey2 are the subkeys of the service or software keys.
When retrieving registry information, ValueName must specify the registry value name to retrieve. When retrieving file path information, ValueName is ignored.
ValueType[in] When retrieving registry information, ValueType must specify the expected registry value type that corresponds to the registry value name. It must be REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ, REG_BINARY, REG_QWORD, or REG_DWORD.
When retrieving file path information, ValueType must be 0 to succeed.
See Registry Value Types for more detail.
PhysicalAdapterIndex[in] The physical adapter index in a LDA chain.
OutputValueSize[out] Size in bytes of the written output if pfnQueryAdapterInfoCb2 succeeds (Status is D3DDDI_QUERYREGISTRY_STATUS_SUCCESS). When Status is D3DDDI_QUERYREGISTRY_STATUS_BUFFER_OVERFLOW, OutputValueSize is the number of bytes required to hold the output value.
Status[out] A D3DDDI_QUERYREGISTRY_STATUS value that indicates the status of the query.
When a user-mode display driver calls the runtime's pfnQueryAdapterInfoCb2 function, a call to the DxgkDdiQueryAdapterInfo function is initiated.
The status of the query is returned separately from the return value in order to indicate that varying amounts of data have been retrieved. The following three return states are the most important to understand:
OutputDword[out] A part of the union that holds the output value. OutputDword is a convenience field for reinterpreting the successfully retrieved data when a registry DWORD is being read.
OutputQword[out] A part of the union that holds the output value. OutputQword is a convenience field for reinterpreting the successfully retrieved data when a registry QWORD is being read.
OutputString[1][out] A part of the union that holds the output value. OutputString is a convenience field for reinterpreting the successfully retrieved data when retrieving a registry string or a file path.
OutputBinary[1][out] A part of the union that holds the output value. OutputBinary is a convenience field for reinterpreting the successfully retrieved data when a registry binary blob is being read.
D3DDDI_QUERYREGISTRY_INFO is used to read the registry for information that is commonly cached during driver installation.
Instead of using raw OS methods, user-mode drivers and other components must ubiquitously use this technique on the OS versions where it is supported. This enables the OS to maximize user-mode compatibility with dependency changes and scenarios like virtualized environments. For more information, see GPU paravirtualization.