## Display Device Driver Reference for OS/2

[prev][next][parent][TOC]

### Windows Driver Calls to VWIN - Accessed via INT 66h

Windows DD - Initialization

        Input:
        AH    = 0x81 - VWIN_INITIALIZE
        DS:SI = "VWIN"
        CX    = SIZEOF windd_init
        EBX   = windd_init struc

        WINDD_INIT  struc
            proc_id      dw  0   ; (out) WinDD's process id
            thread_id    dw  0   ; (out) WinDD's thread id
            pfvwin       dd  ?   ; (out) VWIN's interrupt handler
            pmdd_io      dd  0   ; (out) pointer to pmdd_io structure
        WINDD_INIT  ends

Note:

After this initialization call, instead of issuing INT 66H, the seamless windows driver can call directly into VWIN's interrupt handler using the pfvwin function pointer, passed in the WINDD_INIT structure. If this mechanism is used, the seamless windows driver must first perform a "pushf" before calling VWIN's handler.

The pmdd_io field is a pointer passed directly from the PM display driver. This pointer addresses a structure of values that are shared between the PM and seamless windows display drivers. The definition of this structure is set by the display driver pair. However, as noted above, the first four bytes of the structure must contain some type of signature value agreed on by the display driver pair.

        Output:
        AX    = 0... success
                n... failure code defined by VWIN

Windows DD - Block on FSRamSemaphore

        Input:
        AH    = 0x82 - VWIN_SEM_BLOCK
        EBX   = CPDOS RAM Semaphore
        ECX   = Timeout value
        DS:SI = "VWIN"

        Output:
        AX    = 0... success
                n... failure

Note: Most of the driver semaphore handling is at Ring 3. However, this exception (interrupt) is necessary because the seamless windows driver DOS session cannot make a kernel call. When the video hardware semaphore is in use, the Driver must block, and this requires a call to the kernel through VWIN.

Windows DD - Wakeup FSRamSemaphore request

        Input:
        AH    = 0x83 - VWIN_SEM_WAKE
        EBX   = CPDOS RAM Semaphore
        CX    = old RamSemFlag value
        DS:SI = "VWIN"

Note: When freeing and resetting the FSRamSemaphore, the seamless windows driver first checks whether RamSemFlag in the semaphore structure is 0. If the flag is nonzero, the seamless windows driver must call INT 66h, VWIN_ SEM_WAKE. The RamSemFlag value before being reset is the "old RamSemFlag value".

        Output:
        AX    = 0. . . success (call cannot fail)

Windows DD - Request hardware

        Input:
        AH    = 0x84 - VWIN_REQUEST_VVIDEO
        DS:SI = "VWIN"

        Output:
        AX    = 0. . . success (call cannot fail; call will block
                      until hardware is available)

Note: In seamless processing, three components share the video hardware. These are:

VVIDEO

PM

Windows

PM and Windows coordinate access to the hardware via a FSRamSemaphore. However, virtual video drivers do not have this mechanism available. A virtual driver is never sure when a DOS application is finished accessing the screen; therefore, this interrupt exists to signal to VWIN (which forwards the request to the virtual video driver) that the seamless windows driver needs hardware access. Before making the call, the driver must obtain the hardware semaphore. Upon return, the seamless windows driver is guaranteed exclusive use of the video. (This mechanism of obtaining the semaphore and checking with VVIDEO already exists in the PM Driver code and is not unique to seamless operation.)

Windows DD - Notify that hardware is available.

        Input:
        AH    = 0x85 - VWIN_NOTIFY_VVIDEO
        DS:SI = "VWIN"

        Output:
        AX    = 0. . . success (call cannot fail)

Windows DD - Critical section processing

        Input:
        AH    = 0x86 - VWIN_WINDD_ENTERCRITSEC
        DS:SI = "VWIN"

        Output:
        AX    = 0. . . success (call cannot fail)

        Input:
        AH    = 0x87 - VWIN_WINDD_EXITCRITSEC
        DS:SI = "VWIN"

        Output:
        AX    = 0. . . success (call cannot fail)

Note: The enter/exit critical section calls can be nested and, therefore, must come in pairs. This interrupt usually is issued as part of INT 2Fh processing, when nonreentrant code is being executed. It requests VWIN to temporarily stop sending interrupts to the DOS session.