The DrvGetModes function lists the modes supported by a given device.
ULONG
DrvGetModes(
IN HANDLE hDriver,
IN ULONG cjSize,
OUT DEVMODEW *pdm
);
The driver should return the number of bytes written to the buffer if pdm is not NULL. If pdm is NULL, the driver should return the number of bytes required to hold all mode data. The driver should return zero if an error occurs.
Declared in winddi.h. Include winddi.h.
This function must be implemented in all display drivers.
The Window Manager dynamically loads all display drivers associated with a miniport driver (based on the InstalledDisplayDrivers key in the registry). Each display driver is called to retrieve the list of modes supported by that combination of loaded drivers. For example, the VGA64K display driver only returns the 64K color modes that were returned in the list of modes obtained from the miniport driver.
DrvGetModes can be called before there is an active PDEV.
Refer to the permedia samples to see a working implementation of DrvGetModes.