GetDisplayConfigBufferSizes function (winuser.h)
The GetDisplayConfigBufferSizes function retrieves the size of the buffers that are required to call the QueryDisplayConfig function.
LONG GetDisplayConfigBufferSizes( UINT32 flags, UINT32 *numPathArrayElements, UINT32 *numModeInfoArrayElements );
The type of information to retrieve. The value for the Flags parameter must be one of the following values.
The caller requests the table sizes to hold all the possible path combinations.
The caller requests the table sizes to hold only active paths.
The caller requests the table sizes to hold the active paths as defined in the persistence database for the currently connected monitors.
Pointer to a variable that receives the number of elements in the path information table. The pNumPathArrayElements parameter value is then used by a subsequent call to the QueryDisplayConfig function. This parameter cannot be NULL.
Pointer to a variable that receives the number of elements in the mode information table. The pNumModeInfoArrayElements parameter value is then used by a subsequent call to the QueryDisplayConfig function. This parameter cannot be NULL.
The function returns one of the following return codes.
||The function succeeded.|
||The combination of parameters and flags that are specified is invalid.|
||The system is not running a graphics driver that was written according to the Windows Display Driver Model (WDDM). The function is only supported on a system with a WDDM driver running.|
||The caller does not have access to the console session. This error occurs if the calling process does not have access to the current desktop or is running on a remote session.|
||An unspecified error occurred.|
Given the current display path configuration and the requested flags, GetDisplayConfigBufferSizes returns the size of the path and mode tables that are required to store the information. GetDisplayConfigBufferSizes can return values that are slightly larger than are actually required because it determines that all source and target paths are valid; whereas, the driver might place some restrictions on the possible combinations.
As GetDisplayConfigBufferSizes can only determine the required array size of that moment in time, it is possible that between calls to GetDisplayConfigBufferSizes and QueryDisplayConfig the system configuration has changed and the provided array sizes are no longer sufficient to store the new path data.
If a caller is aware that it must enable additional sources and targets, the caller can allocate a larger mode information array than is returned from GetDisplayConfigBufferSizes so that it has the space to add the additional source and target modes after calling QueryDisplayConfig and before calling SetDisplayConfig.
|Minimum supported client||Available in Windows Vista and later versions of the Windows operating systems.|
|Header||winuser.h (include Windows.h)|
|Library||User32.lib; OneCoreUAP.lib on Windows 10|
|API set||ext-ms-win-ntuser-sysparams-ext-l1-1-1 (introduced in Windows 10, version 10.0.14393)|