Question

I'm developing a launcher application for a 3D game on Windows. The configuration "ini" file requires the user to specify the hardware GUID for the desired device, as in, the Device Identifier GUID returned by dxdiag.exe.

I'm trying to list the available adapters on the system, allow the user to select one and load that device's hardware GUID into the ini file.

I've examined many methods for attempting this. I've tried using the System.Management class, which returns the class GUID but not the specific driver GUID. I've tried using native calls to SetupAPI.h functions, which also seem to not be able to list the specific Device Identifier GUID. I've tried examining the registry, to see if the GUID resides there. No luck.

My best idea was probably using the Managed DirectX library to return the GUID I'm looking for, considering that's probably how dxdiag does it. I was able to enumerate and collect hardware information about each driver using the SharpDX Managed DirectX interface for .NET applications (I'm targeting framework 3.5), but again, I wasn't able to return the same GUID that dxdiag returns.

I'm really stuck for a solution. Help?

Was it helpful?

Solution

Managed to solve it myself.

Decided the best way to solve this was using DirectX. Imported DX libraries, changed my app to x86. The code I was looking for was:

Manager.Adapters[0].Information.DeviceIdentifier
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top