DEVESC_SWITCHBANK
GreEscape DEVESC_SWITCHBANK changes which bank of video memory is mapped to the aperture that is returned by DEVESC_GETAPERTURE. The escape is intended to allow the calling routine to switch banks in a device-independent fashion, and then access video memory directly.
This escape must be bracketed by calls to DEVESC_ACQUIREFB and DEVESC_DEACQUIREFB. These calls ensure serial access to the bank-switching resources of the device.
Currently, this call will only be used on adapters configured with apertures smaller than the visible video memory. Adapters with adequately sized apertures do not require the calling routine to acquire and deacquire the device in order to share the bank-switching resource.
This call is required for adapters that have a 64KB aperture in the 256-color mode. An XGA adapter has a 64KB aperture mode and most Super VGA adapters also use a 64KB aperture.
- Simulation support
- This function is mandatory for display drivers supporting software motion video. For other drivers, it is simulated by a handling routine in the graphics engine.
Syntax
GreEscape(hdc, lCode, lInCount, pbInData, plOutCount, pbOutData);
Parameters
- hdc (HDC) - input
- Device context handle.
- lCode (LONG) - input
- DEVESC_SWITCHBANK escape code.
- lInCount (LONG) - input
- Number of bytes pointed to by pInData.
- pbInData (PBYTE) - input
- Pointer to a SWITCHBANK structure containing:
- ulBankNum Specifies the aperture bank to be made active: zero (0) for the first bank, one (1) for the second, and so on.
- plOutCount (PLONG) - input
- The handling routine ignores this parameter.
- pbOutData (PLONG) - input
- The handling routine ignores this parameter.
Returns
- rc (LONG) - returns
- Return Code.
- The handling routine returns:
- DEV_OK
- Successful
- DEVESC_NOTIMPLEMENTED
- Escape not implemented for specified code
- DEVESC_ERROR
- Error
Source Code Sample
Declaration:
#define INCL_GRE_DEVICE #include <os2.h> HDC hdc; /* Device context handle. */ LONG lCode; /* DEVESC_SWITCHBANK escape code. */ LONG lInCount; /* Number of bytes pointed to by pInData. */ PBYTE pbInData; /* Pointer to a SWITCHBANK structure containing: */ PLONG plOutCount; /* The handling routine ignores this parameter. */ PLONG pbOutData; /* The handling routine ignores this parameter. */ LONG rc; /* Return Code. */ rc = GreEscape(hdc, lCode, lInCount, pbInData, plOutCount, pbOutData);