Difference between revisions of "VioScrLock"

From EDM2
Jump to: navigation, search
(Created page with "==Description== Requests ownership of (locks) the physical display buffer. ==Syntax== <PRE> #define INCL_VIO #include <os2.h> ULONG WaitFlag; /* Wait until screen I/O...")
 
m
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
==Description==
 
 
Requests ownership of (locks) the physical display buffer.
 
Requests ownership of (locks) the physical display buffer.
  
 
==Syntax==
 
==Syntax==
<PRE>
+
VioScrLock(WaitFlag, Status, VioHandle)
#define INCL_VIO
+
#include <os2.h>
+
  
ULONG    WaitFlag;  /*  Wait until screen I/O can take place. */
 
PUCHAR    Status;    /*  Address of the lock status. */
 
HVIO      VioHandle;  /*  VIO presentation-space handle. */
 
APIRET    rc;        /*  Return code. */
 
 
rc = VioScrLock(WaitFlag, Status, VioHandle);
 
 
</PRE>
 
 
==Parameters==
 
==Parameters==
; WaitFlag (ULONG) - input : Wait until screen I/O can take place.
+
;WaitFlag (ULONG) - input: Wait until screen I/O can take place.
Indicates whether the process should block until the screen I/O can take place.
+
: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 lock status.
    1           Wait until screen I/O is available.  
+
:The lock status may be one of the following values:
 
+
::0 - Lock successful.
; Status (PUCHAR) - output : Address of the lock status.
+
::1 - Lock unsuccessful (in the case of no wait).
The lock status may be one of the following values:
+
:Status is returned only when AX = 0. Status = 1 can be returned only when WaitFlag = 0.
 
+
;VioHandle ([[HVIO]]) - input: VIO presentation-space handle.
Value                    Definition
+
:Reserved. Must be 0.
  0                   Lock successful.  
+
  1                   Lock unsuccessful (in the case of no wait).  
+
                    Status is returned only when AX = 0.  
+
                    Status = 1 can be returned only when WaitFlag = 0.  
+
 
+
; VioHandle (HVIO) - input : VIO presentation-space handle.
+
Reserved. Must be 0.
+
  
 
==Return Code==
 
==Return Code==
rc (APIRET) - returns
+
;rc (APIRET) - returns:VioScrLock returns one of the following values:
 
+
*0 NO_ERROR
VioScrLock returns one of the following values:
+
*366 ERROR_VIO_WAIT_FLAG
 
+
*421 ERROR_VIO_INVALID_PARMS
* 0         NO_ERROR  
+
*430 ERROR_VIO_ILLEGAL_DURING_POPUP
* 366       ERROR_VIO_WAIT_FLAG  
+
*434 ERROR_VIO_LOCK
* 421       ERROR_VIO_INVALID_PARMS  
+
*436 ERROR_VIO_INVALID_HANDLE
* 430       ERROR_VIO_ILLEGAL_DURING_POPUP  
+
* 434       ERROR_VIO_LOCK  
+
* 436       ERROR_VIO_INVALID_HANDLE  
+
 
+
 
+
  
 
==Remarks==
 
==Remarks==
Line 54: Line 31:
 
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.
 
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 the same thread 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 the same thread that issued VioScrLock.
 
+
==Example Code==
+
<PRE>
+
 
+
</PRE>
+
==Related Functions==
+
* [[OS2 API:CPI:
+
 
+
  
[[Category:The OS/2 API Project]]
+
[[Category:Vio]]

Latest revision as of 19:21, 1 January 2020

Requests ownership of (locks) the physical display buffer.

Syntax

VioScrLock(WaitFlag, Status, VioHandle)

Parameters

WaitFlag (ULONG) - input
Wait until screen I/O can take place.
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 lock status.
The lock status may be one of the following values:
0 - Lock successful.
1 - Lock unsuccessful (in the case of no wait).
Status is returned only when AX = 0. Status = 1 can be returned only when WaitFlag = 0.
VioHandle (HVIO) - input
VIO presentation-space handle.
Reserved. Must be 0.

Return Code

rc (APIRET) - returns
VioScrLock returns one of the following values:
  • 0 NO_ERROR
  • 366 ERROR_VIO_WAIT_FLAG
  • 421 ERROR_VIO_INVALID_PARMS
  • 430 ERROR_VIO_ILLEGAL_DURING_POPUP
  • 434 ERROR_VIO_LOCK
  • 436 ERROR_VIO_INVALID_HANDLE

Remarks

VioScrLock 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 the same thread that issued VioScrLock.