Class Dxgi

java.lang.Object
oshi.jna.platform.windows.Dxgi

public final class Dxgi extends Object
Minimal JNA binding to dxgi.dll for enumerating display adapters and reading DXGI_ADAPTER_DESC.DedicatedVideoMemory.

DXGI is the authoritative Windows API for dedicated GPU memory. It is not subject to the 2 GiB cap that affects the 32-bit registry value HardwareInformation.MemorySize.

COM vtable layout used here:

IUnknown   (vtable slots 0-2):  QueryInterface, AddRef, Release
IDXGIObject (slots 3-6):        SetPrivateData, SetPrivateDataInterface, GetPrivateData, GetParent
IDXGIFactory (slots 7-13):      EnumAdapters, MakeWindowAssociation, GetWindowAssociation,
                                 CreateSwapChain, CreateSoftwareAdapter, (IDXGIFactory1 adds 2 more)
IDXGIAdapter (slots 3-5 on adapter): EnumOutputs, GetDesc, CheckInterfaceSupport

This class should be considered non-API as it may be removed if/when its code is incorporated into the JNA project.

  • Method Details

    • queryAdapters

      public static List<oshi.driver.common.windows.gpu.DxgiAdapterInfo> queryAdapters()
      Enumerates all DXGI display adapters and returns their identity and dedicated video memory.

      Fails gracefully: if dxgi.dll is unavailable or any COM call fails, returns an empty list so callers can fall back to registry-based detection.

      Returns:
      list of DxgiAdapterInfo, one per adapter; empty if DXGI is unavailable