DrvGetModes

This function lists the modes supported by a specified device.

Syntax

ULONG DrvGetModes( IN HANDLE hDriver, IN ULONG cjSize,
OUT DEVMODEW *
pdm );

Parameters

hDriver
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
Pointer to the buffer in which DEVMODEW structures will be written.

Return Values

Returns the count of bytes written to the buffer, or, if pdm is null, the number of bytes required to hold all mode data. Zero indicates failure.

Remarks

This function is required for display drivers. It is called indirectly by the Display option in 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 64 KB color modes that were returned in the list of modes obtained from the miniport driver.

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