DrvGetModes

ULONG DrvGetModes(

    IN HANDLE hDriver,

    IN ULONG cjSize,

    OUT DEVMODEW *pdm

   );

DrvGetModes lists the modes supported by a given device.

Parameters

hDriver
Specifies the handle to the kernel driver for which the modes must be enumerated. This is the handle that is passed in the hDriver parameter of the DrvEnablePDEV function.
cjSize
Specifies the size, in bytes, of the buffer pointed to by pdm.
pdm
Points to the buffer in which DEVMODEW structures will be written.

Return Value

The return value is the count of bytes written to the buffer, or, if pdm is null, the number of bytes required to hold all mode data. If an error occurs, the return value is zero, and an error code is logged.

Comments

This function is required for display drivers. It is called indirectly by the Display applet contained within the Control Panel to get the list of supported modes.

The Window Manager (user.exe) dynamically loads all display drivers associated with a miniport (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.

The DrvGetModes function can be called even when the display driver has not been loaded.

See Also

DEVMODEW, DrvAssertMode, DrvEnablePDEV