## Display Device Driver Reference for OS/2

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

### Video Device Handler Interfaces

The functions that follow are video primitives reserved for use by OS/2 system components. Unexpected results can occur if these functions are started by applications. All of the video device handler functions described below (except for the DLL Initialization function) use the same calling sequence. Parameters are passed to the routines on the stack. The entry point is found in the BVH Call Vector Table at the index of the function number. The calling sequence used to invoke all the routines is as follows:

         PUSH@    OTHER    Environment        ; Environment buffer
         PUSH@    OTHER    ParmBlock          ; Parameter block
         PUSH     DWORD    Function           ; Function number

         CALL     FAR      BVH Routine Entry Point

Environment:

The environment buffer. The format of this buffer is defined by the BVH developer. The selector is a huge selector.

ParmBlock:

A data structure containing all of the parameters of the operation to be performed. The general format of this structure is:

        Length of parameter block in bytes (=NN)  WORD
        Flags                                     WORD

        Bit 0 indicates whether the physical hardware is updated.

            OFF = Initialize only the environment buffer
            ON  = Initialize the environment buffer and the hardware state

        Bits 1 through 15 are reserved and must be OFF.

The length of the parameter block is the total length, including the length field itself. The number in parentheses ( =NN ) represents the value of this field, if it is a constant.

The first flag bit always indicates a background versus foreground state for this function. If the bit is ON, the adapter is actually updated, as it is when an application is in the foreground. If the bit is OFF, only the buffer that is used to shadow the adapter when an application is in the background is actually updated. All bits that are not currently defined as reserved must be OFF.

Function:

The function identifier for this routine. This corresponds to the offset into the Call Vector Table, and can be used to determine the number of parameters on the stack. This is consistent with the existing DDI used by the Presentation Manager interface. All routines are expected to return with AX = 0 if no error was detected. Otherwise, an error code is returned in AX. The following errors are common to all commands:

        ERROR_VIO_INVALID_LENGTH, if the parameter block length is incorrect.
        ERROR_VIO_INVALID_PARMS,  if a reserved flag bit is non-zero, or if
                                  the function number does not match the routine.