Jump to content

VioGetBuf (FAPI): Difference between revisions

From EDM2
Created page with "==Description== This call returns the address of the logical video buffer (LVB). ==Syntax== <PRE> VioGetBuf (LVBPtr, Length, VioHandle) </PRE> ==Parameters== ; LVBPtr..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
==Description==
This call returns the address of the logical video buffer (LVB).
This call returns the address of the logical video buffer (LVB).


==Syntax==
==Syntax==
<PRE>
  VioGetBuf (LVBPtr, Length, VioHandle)
  VioGetBuf
 
    (LVBPtr, Length, VioHandle)
</PRE>


==Parameters==
==Parameters==
; LVBPtr (PULONG) - output : Address of the selector and offset of the logical video buffer. Applications should not assume the offset portion of this far address is 0.  
;LVBPtr (PULONG) - output : Address of the selector and offset of the logical video buffer. Applications should not assume the offset portion of this far address is 0.
 
;Length (PUSHORT) - output : Address of the length buffer in bytes. The length is: number of rows * number of columns * size of cell.
; Length (PUSHORT) - output : Address of the length buffer in bytes. The length is: number of rows * number of columns * size of cell.  
;VioHandle (HVIO) - input : This must be zero unless the caller is a Presentation Manager application, in which case it must be the value returned by VioGetPs.
 
; VioHandle (HVIO) - input : This must be zero unless the caller is a Presentation Manager application, in which case it must be the value returned by VioGetPs.


==Return Code==
==Return Code==
  rc (USHORT) - return
  rc (USHORT) - return
Return code descriptions are:
Return code descriptions are:
* 0          NO_ERROR  
* 0          NO_ERROR  
* 355        ERROR_VIO_MODE  
* 355        ERROR_VIO_MODE  
Line 26: Line 17:
* 436        ERROR_VIO_INVALID_HANDLE  
* 436        ERROR_VIO_INVALID_HANDLE  
* 465        ERROR_VIO_DETACHED
* 465        ERROR_VIO_DETACHED
==Remarks==
==Remarks==
An application using VioGetBuf can prepare a screen in the application's own logical video buffer (LVB) offline. When the application is in the foreground, the physical screen buffer is updated from the LVB when VioShowBuf is issued. When the application runs in the background, the physical screen buffer is updated when the application is switched to the foreground.
An application using VioGetBuf can prepare a screen in the application's own logical video buffer (LVB) offline. When the application is in the foreground, the physical screen buffer is updated from the LVB when VioShowBuf is issued. When the application runs in the background, the physical screen buffer is updated when the application is switched to the foreground.
Line 34: Line 26:


If VioSetMode is issued following a VioGetBuf call, the size of the logical video buffer is adjusted to correspond to the new mode. There is one logical video buffer per session (or presentation space if AVIO application) that corresponds to the current mode on the current display configuration.
If VioSetMode is issued following a VioGetBuf call, the size of the logical video buffer is adjusted to correspond to the new mode. There is one logical video buffer per session (or presentation space if AVIO application) that corresponds to the current mode on the current display configuration.


===PM Considerations===
===PM Considerations===
This function returns the address and length of the Advanced VIO presentation space. The presentation space may be used to directly manipulate displayed information.  
This function returns the address and length of the Advanced VIO presentation space. The presentation space may be used to directly manipulate displayed information.  


Line 68: Line 58:


==Related Functions==
==Related Functions==
*  
* VioShowBuf


[[Category:The OS/2 API Project]]
[[Category:Vio]]

Revision as of 20:27, 26 February 2017

This call returns the address of the logical video buffer (LVB).

Syntax

VioGetBuf (LVBPtr, Length, VioHandle)

Parameters

LVBPtr (PULONG) - output
Address of the selector and offset of the logical video buffer. Applications should not assume the offset portion of this far address is 0.
Length (PUSHORT) - output
Address of the length buffer in bytes. The length is: number of rows * number of columns * size of cell.
VioHandle (HVIO) - input
This must be zero unless the caller is a Presentation Manager application, in which case it must be the value returned by VioGetPs.

Return Code

rc (USHORT) - return

Return code descriptions are:

  • 0 NO_ERROR
  • 355 ERROR_VIO_MODE
  • 430 ERROR_VIO_ILLEGAL_DURING_POPUP
  • 436 ERROR_VIO_INVALID_HANDLE
  • 465 ERROR_VIO_DETACHED

Remarks

An application using VioGetBuf can prepare a screen in the application's own logical video buffer (LVB) offline. When the application is in the foreground, the physical screen buffer is updated from the LVB when VioShowBuf is issued. When the application runs in the background, the physical screen buffer is updated when the application is switched to the foreground.

Once VioGetBuf is issued, all VioWrtXX calls issued while the application is running in the foreground are written to the physical display buffer and LVB. If a VioGetPhysBuf is subsequently issued, then the VioWrtXX calls are only written to the physical display buffer. They are no longer written to the LVB.

VioGetMode may be used to determine the dimensions of the buffer.

If VioSetMode is issued following a VioGetBuf call, the size of the logical video buffer is adjusted to correspond to the new mode. There is one logical video buffer per session (or presentation space if AVIO application) that corresponds to the current mode on the current display configuration.

PM Considerations

This function returns the address and length of the Advanced VIO presentation space. The presentation space may be used to directly manipulate displayed information.

Example Code

C Binding

#define INCL_VIO

USHORT  rc = VioGetBuf(LVBPtr, Length, VioHandle);

PULONG           LVBPtr;        /* Points to LVB */
PUSHORT          Length;        /* Length of buffer */
HVIO             VioHandle;     /* Vio handle */

USHORT           rc;            /* return code */

MASM Binding

EXTRN  VioGetBuf:FAR
INCL_VIO            EQU 1

PUSH@  DWORD   LVBPtr        ;Points to LVB
PUSH@  WORD    Length        ;Length of buffer
PUSH   WORD    VioHandle     ;Vio handle
CALL   VioGetBuf

Returns WORD

Related Functions

  • VioShowBuf