Jump to content

OS2 PM DRV QUERYSCREENRESOLUTIONS: Difference between revisions

From EDM2
Created page with "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_QUERYS..."
 
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
OS2_PM_DRV_QUERYSCREENRESOLUTIONS allows the operating system to display to the user the display modes that are supported by the display driver.  
OS2_PM_DRV_QUERYSCREENRESOLUTIONS allows the operating system to display to the user the display modes that are supported by the display driver.
 
==Syntax==
==Syntax==
  OS2_PM_DRV_QUERYSCREENRESOLUTIONS(pBuf, pcbBuf);
  OS2_PM_DRV_QUERYSCREENRESOLUTIONS(pBuf, pcbBuf)
 
==Parameters==
==Parameters==
;pBuf (PVOID) - input  
;pBuf (PVOID) - input:Pointer to the output buffer.
: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:
;pcbBuf (PULONG) - input  
:;maxcount:Total number of screen resolutions supported.
:Pointer to the number of bytes in the buffer.  
:;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.
:;pBuf  
::The SCREENRESCOUNT information should be followed by the SCREENRESOLUTION information:
::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:  
:::width Width of the device in pels.  
 
::: height Height of the device in pels.  
maxcount Total number of screen resolutions supported.  
::: colors Number of colors supported in this mode.  
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.  
::: planes Number of display planes in this mode.  
:::floptions Optional information for each resolution.  
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.  
:::Valid values include:  
:::DSP_RESOLUTION_OBTAINABLE Obtainable with the hardware configuration  
:::The SCREENRESCOUNT information should be followed by the SCREENRESOLUTION information:  
::: 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.
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==
==Return Code==
; rc (LONG) - returns  
;rc (LONG) - returns: Return codes
: 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.
The returned value depends upon the input value of pcbBuf.  
* Nonzero Return the number of bytes actually returned in pBuf.
 
* 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.  
 
 
==Remarks==


==Example Code==
==Example Code==
Line 47: Line 32:
#include <os2.h>
#include <os2.h>


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


rc = OS2_PM_DRV_QUERYSCREENRESOLUTIONS(
rc = OS2_PM_DRV_QUERYSCREENRESOLUTIONS(pBuf, pcbBuf);
      pBuf, pcbBuf);
</PRE>
</PRE>
==Related Functions==


[[Category:Gre]]
[[Category:Gre]]
{{DISPLAYTITLE:OS2_PM_DRV_QUERYSCREENRESOLUTIONS}}

Latest revision as of 16:18, 8 February 2020

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);