void QueryD3DRegistryInfo::PerformQuery()

in library/src/D3DHelpers.cpp [43:62]


void QueryD3DRegistryInfo::PerformQuery(unique_adapter_handle& adapter)
{
	while (true)
	{
		// Attempt to perform the query
		auto adapterQuery = this->CreateAdapterQuery(adapter);
		auto error = CheckNtStatus(D3DKMTQueryAdapterInfo(&adapterQuery));
		if (error) {
			throw error.Wrap(L"D3DKMTQueryAdapterInfo failed");
		}
		
		// Determine whether we need to resize the trailing buffer and try again
		if (this->RegistryInfo->Status == D3DDDI_QUERYREGISTRY_STATUS_BUFFER_OVERFLOW) {
			this->Resize(this->RegistryInfo->OutputValueSize);
		}
		else {
			return;
		}
	}
}