Jump to content

OS2_PM_DRV_QUERYSCREENRESOLUTIONS

From EDM2
Revision as of 16:18, 8 February 2020 by Martini (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

OS2_PM_DRV_QUERYSCREENRESOLUTIONS allows the operating system to display to the user the display modes that are supported by the display driver.

Syntax

OS2_PM_DRV_QUERYSCREENRESOLUTIONS(pBuf, pcbBuf)

Parameters

pBuf (PVOID) - input
Pointer to the output buffer.
pcbBuf (PULONG) - input
Pointer to the number of bytes in the buffer.
pBuf
Pointer to the buffer that receives the output from this function. The output is returned in a SCREENRESCOUNT structure followed by an array of SCREENRESOLUTION structures. pBuf should contain the following SCREENRESCOUNT information:
maxcount
Total number of screen resolutions supported.
count
Number of SCREENRESOLUTION structures returned. This count will be less than maxcount if the defined size of the pBuf buffer is too small as identified by pcbBuf.
res_struct_length
Length of a SCREENRESOLUTION structure. This value should be used to increment between structures so that any future increase in the size of the structure (to add information) will not cause a failure.
The SCREENRESCOUNT information should be followed by the SCREENRESOLUTION information:
width Width of the device in pels.
height Height of the device in pels.
colors Number of colors supported in this mode.
planes Number of display planes in this mode.
floptions Optional information for each resolution.
Valid values include:
DSP_RESOLUTION_OBTAINABLE Obtainable with the hardware configuration
DSP_RESOLUTION_DEFAULT Default resolution for the hardware configuration
pcbBuf
Pointer to the number of bytes in the pScreenResolution buffer. If pScreenResolution is 0 on input, this function stores the size (in bytes) needed to retrieve all of the screen resolution data in pcbScreenResolution. If not 0, this field contains the number of bytes actually returned.

Return Code

rc (LONG) - returns
Return codes

The returned value depends upon the input value of pcbBuf.

  • 0 Return the size in bytes needed to retrieve all of the screen resolution data.
  • Nonzero Return the number of bytes actually returned in pBuf.

Example Code

#include <os2.h>

PVOID     pBuf;    /* Pointer to the output buffer. */
PULONG    pcbBuf;  /* Pointer to the number of bytes in the buffer. */
LONG      rc;      /* Return codes */

rc = OS2_PM_DRV_QUERYSCREENRESOLUTIONS(pBuf, pcbBuf);