Jump to content

VioScrLock (FAPI): Difference between revisions

From EDM2
Created page with "==Description== This call requests ownership of (locks) the physical display buffer. ==Syntax== <PRE> VioScrLock (WaitFlag, Status, VioHandle) </PRE> ==Parameters== ;..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This call requests ownership of (locks) the physical display buffer.
This call requests ownership of (locks) the physical display buffer.


==Syntax==
==Syntax==
<PRE>
  VioScrLock (WaitFlag, Status, VioHandle)
  VioScrLock
 
    (WaitFlag, Status, VioHandle)
</PRE>


==Parameters==  
==Parameters==  
; WaitFlag (USHORT) - input : Indicates whether the process should block until the screen I/O can take place.
;WaitFlag (USHORT) - input: Indicates whether the process should block until the screen I/O can take place.
 
::0 Return if screen I/O not available
'''Value        Definition'''
::1 Wait until screen I/O is available.
0       Return if screen I/O not available
;Status (PUCHAR) - output : Address of the Indicator of whether the lock is successful, described below.
1       Wait until screen I/O is available.  
::0 Lock successful
 
::1 Lock unsuccessful (in the case of no wait).
; Status (PUCHAR) - output : Address of the Indicator of whether the lock is successful, described below.
:Status is returned only when AX = 0.
 
:Status = 1 may be returned only when WaitFlag = 0.
'''Value            Definition'''
;VioHandle (HVIO) - input: Reserved word of 0s.
0           Lock successful
1           Lock unsuccessful (in the case of no wait).
 
Status is returned only when AX = 0.
 
Status = 1 may be returned only when WaitFlag = 0.  
 
; VioHandle (HVIO) - input : Reserved word of 0s.


==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
 
*0 NO_ERROR
Return code descriptions are:
*366 ERROR_VIO_WAIT_FLAG
 
*430 ERROR_VIO_ILLEGAL_DURING_POPUP
* 0         NO_ERROR  
*434 ERROR_VIO_LOCK
* 366       ERROR_VIO_WAIT_FLAG  
*436 ERROR_VIO_INVALID_HANDLE
* 430       ERROR_VIO_ILLEGAL_DURING_POPUP  
*465 ERROR_VIO_DETACHED
* 434       ERROR_VIO_LOCK  
*494 ERROR_VIO_EXTENDED_SG
* 436       ERROR_VIO_INVALID_HANDLE  
* 465       ERROR_VIO_DETACHED  
* 494       ERROR_VIO_EXTENDED_SG


==Remarks==
==Remarks==
Line 47: Line 31:


When the screen lock is in effect and another thread in the same or different process (in the same session) issues VioScrLock, the second thread receives an error code. VioScrUnLock must be issued by a thread within the same process that issued VioScrLock.
When the screen lock is in effect and another thread in the same or different process (in the same session) issues VioScrLock, the second thread receives an error code. VioScrUnLock must be issued by a thread within the same process that issued VioScrLock.


===Family API Considerations===
===Family API Considerations===
Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restriction applies to VioScrLock when coding in the DOS mode:
Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restriction applies to VioScrLock when coding in the DOS mode:


The status always indicates the lock is successful (Return code = 0).  
The status always indicates the lock is successful (Return code = 0).


==Example Code==
==Bindings==
=== C Binding===
===C===
<PRE>
<PRE>
#define INCL_VIO
#define INCL_VIO
Line 62: Line 44:
USHORT  rc = VioScrLock(WaitFlag, Status, VioHandle);
USHORT  rc = VioScrLock(WaitFlag, Status, VioHandle);


USHORT           WaitFlag;      /* Block or not */
USHORT WaitFlag;      /* Block or not */
PUCHAR           Status;        /* Lock status (returned) */
PUCHAR Status;        /* Lock status (returned) */
HVIO             VioHandle;    /* Video handle */
HVIO   VioHandle;    /* Video handle */


USHORT           rc;            /* return code */
USHORT rc;            /* return code */
</PRE>
</PRE>


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  VioScrLock:FAR
EXTRN  VioScrLock:FAR
Line 82: Line 64:
</PRE>
</PRE>


==Related Functions==
[[Category:Vio]]
*
 
[[Category:The OS/2 API Project]]

Latest revision as of 17:05, 28 February 2020

This call requests ownership of (locks) the physical display buffer.

Syntax

VioScrLock (WaitFlag, Status, VioHandle)

Parameters

WaitFlag (USHORT) - input
Indicates whether the process should block until the screen I/O can take place.
0 Return if screen I/O not available
1 Wait until screen I/O is available.
Status (PUCHAR) - output
Address of the Indicator of whether the lock is successful, described below.
0 Lock successful
1 Lock unsuccessful (in the case of no wait).
Status is returned only when AX = 0.
Status = 1 may be returned only when WaitFlag = 0.
VioHandle (HVIO) - input
Reserved word of 0s.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 366 ERROR_VIO_WAIT_FLAG
  • 430 ERROR_VIO_ILLEGAL_DURING_POPUP
  • 434 ERROR_VIO_LOCK
  • 436 ERROR_VIO_INVALID_HANDLE
  • 465 ERROR_VIO_DETACHED
  • 494 ERROR_VIO_EXTENDED_SG

Remarks

This function call permits a process to determine if I/O to the physical screen buffer can take place. This prevents the process from writing to the physical buffer when the process is in the background. Processes must cooperate with the system in coordinating screen accesses.

Screen switching is disabled while the screen lock is in place. If a screen switch is suspended by a screen lock, and if the application holding the lock does not issue VioScrUnLock within a system-defined time limit, the screen switch occurs, and the process holding the lock is frozen in the background. A process should yield the screen lock as soon as possible to avoid being frozen when running in the background. The timeout on the lock does not begin until a screen switch is requested.

When the screen lock is in effect and another thread in the same or different process (in the same session) issues VioScrLock, the second thread receives an error code. VioScrUnLock must be issued by a thread within the same process that issued VioScrLock.

Family API Considerations

Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restriction applies to VioScrLock when coding in the DOS mode:

The status always indicates the lock is successful (Return code = 0).

Bindings

C

#define INCL_VIO

USHORT  rc = VioScrLock(WaitFlag, Status, VioHandle);

USHORT  WaitFlag;      /* Block or not */
PUCHAR  Status;        /* Lock status (returned) */
HVIO    VioHandle;     /* Video handle */

USHORT  rc;            /* return code */

MASM

EXTRN  VioScrLock:FAR
INCL_VIO            EQU 1

PUSH   WORD    WaitFlag      ;Block or not
PUSH@  BYTE    Status        ;Lock status (returned)
PUSH   WORD    VioHandle     ;Video handle
CALL   VioScrLock

Returns WORD