PDRIVER_IO_PORT_USHORT_STRING callback function (video.h)

SvgaHwIoPortUshortString traps an I/O port range to which a full-screen MS-DOS application in an x86-based machine is sending a sequence of USHORT-sized data.

Syntax

PDRIVER_IO_PORT_USHORT_STRING PdriverIoPortUshortString;

VP_STATUS PdriverIoPortUshortString(
  ULONG_PTR Context,
  ULONG Port,
  UCHAR AccessMode,
  PUSHORT Data,
  ULONG DataLength
)
{...}

Parameters

Context

Specifies the miniport driver-determined context value that was set in EmulatorAccessEntriesContext of VIDEO_PORT_CONFIG_INFO.

Port

Specifies the mapped I/O port to be trapped.

AccessMode

Specifies the type of access allowed, which can be one or a combination (ORed) of the following values:

EMULATOR_READ_ACCESS
EMULATOR_WRITE_ACCESS

Data

Pointer to the string of USHORT data values to be transferred. This string is accessed one value at a time until all values have been hooked.

DataLength

Specifies the number of USHORT values in the string.

Return value

SvgaHwIoPortUshortString returns the final status of the operation.

Remarks

Only miniport drivers of VGA-compatible SVGA adapters have SvgaHwIoPortXxx functions. (See SVGA Functions.)

SvgaHwIoPortUshortString intercepts any range access attempted by a full-screen MS-DOS application issuing either or both of the instructions REP OUTSW DX, ESI and REP INSW EDI, DX.

If the miniport driver enables the Port range for direct access by calling VideoSetTrappedEmulatorPorts, its SvgaHwIoPortUshortString function will not be called. Such an application then will have direct access to the I/O port range, unless the miniport driver disables the Port range with another call to VideoSetTrappedEmulatorPorts.

If one or more application-issued x86 INSW or OUTSW instructions might affect the state of the VGA-compatible adapter sequencer register, miscellaneous output register, or any adapter-specific register and, thereby, cause the machine to hang, the miniport driver must not enable the port for direct access by calling VideoPortSetTrappedEmulatorPorts.

SvgaHwIoPortUshortString must buffer subsequent instructions from the application and check that none can hang the machine. If the application issues any sequence of instructions that might hang the machine, SvgaHwIoPortUshortString must discard the buffered instructions. Otherwise, it should output them, a USHORT at a time, to the specified, mapped I/O port.

SvgaHwIoPortUshortString should be made pageable.

Requirements

Requirement Value
Target Platform Desktop
Header video.h (include Video.h)

See also

EMULATOR_ACCESS_ENTRY

SVGA Functions

SvgaHwIoPortUshort

VIDEO_ACCESS_RANGE

VIDEO_PORT_CONFIG_INFO

VideoPortGetDeviceBase

VideoPortSetTrappedEmulatorPorts