2.1 VTNT_CHAR_INFO

VTNT_CHAR_INFO is a variable-length structure that the server uses to send characters that are to be repainted in the client console window.

VTNT_CHAR_INFO encapsulates console window coordinate information and the specific characters and their attributes to be displayed. The coordinates are expressed in terms of coordinates in a grid based on character cells. The upper-left corner of the grid has coordinates (0, 0).


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Dwsize

DwcursorPosition

WAttributes

SrWindow

...

...

dwMaximum

...

coCursorPos_x

coCursorPos_y

coDest

...

coSizeOfData_x

coSizeOfData_y

srDestRegion_Left

srDestRegion_Top

srDestRegion_Right

srDestRegion_Bottom

Vtnt_char_array (variable)

...

Dwsize (4 bytes): Dwsize is a 4-byte unsigned integer field that is not used. The server SHOULD fill this field with zeros. The client MUST ignore this field.

DwcursorPosition (4 bytes): DwcursorPosition is a 4-byte unsigned integer field that is not used. The server SHOULD fill this field with zeros. The client MUST ignore this field.

WAttributes (2 bytes): A 2-byte unsigned integer field that specifies whether the console window coordinates specified by the srDestRegion_left, srDestRegion_top, srDestRegion_right, and srDestRegion_bottom fields are relative or absolute. This field MUST contain one of the following values:

Value

Meaning

ABSOLUTE_COORDS

0x0000

Specifies that srDestRegion_left, srDestRegion_top, srDestRegion_right, and srDestRegion_bottom fields identify the region in the server's console window. The server sends the characters and character attributes that are displayed in this region in the Char and Char_Attributes fields of this structure. A client implementation, while calculating the region to be repainted in the client's console screen buffer, is to take in to account the offset of the client's console window within the client's console screen buffer.

RELATIVE_COORDS

0x0001

An implementation MUST use RELATIVE_COORDS to specify that the data SHOULD be appended to the current contents of the client's console window. In case the wAttributes is set to RELATIVE_COORDS, the client MUST not use the srDestRegion_left, srDestRegion_top, srDestRegion_right and srDestRegion_bottom values, even if the server has filled them with any value. Instead, a client implementation is to calculate the console screen buffer coordinates based on the coSizeOfData_x and coSizeOfData_y fields. A client implementation, when writing the received data to the console screen buffer, is to take care of buffer scrolling if the buffer overflows.

SrWindow (8 bytes): An 8-byte field that is not used. The server SHOULD fill this field with zeros. The client MUST ignore this field.

dwMaximum (4 bytes): A 4-byte unsigned integer field that is not used. The server SHOULD fill this field with zeros. The client MUST ignore this field.

coCursorPos_x  (2 bytes): A 2-byte unsigned integer field that specifies the x-coordinate of the cursor's current position in the server's console window. The x-coordinate MUST be a value between 0 and the right-most character position, inclusive, expressed as an offset from the left-most column position that a character can occupy.

coCursorPos_y (2 bytes): A 2-byte unsigned integer field that specifies the y-coordinate of the cursor's current position in the console window. The y-coordinate MUST be a value between 0 and the bottom-most character position, inclusive, expressed as an offset from the top-most row position that a character can occupy.

coDest (4 bytes): A 4-byte-long field that is not used. The server SHOULD fill this field with zeros. The client MUST ignore this field.

coSizeOfData_x (2 bytes): A 2-byte unsigned integer field that specifies the number of character cell columns that the client MUST paint. This MUST be a value between 0 and the right-most character position, inclusive.

coSizeOfData_y (2 bytes): A 2-byte unsigned integer field that specifies the number of character cell rows that the client MUST paint. This MUST be a value between 0 and the bottom-most character position, inclusive.

srDestRegion_Left (2 bytes): A 2-byte unsigned integer field that specifies the x-coordinate of the upper-left corner of a rectangle in the server's console window. This MUST be a value between 0 and the right-most character position, inclusive, expressed as an offset from the left-most column that a character can occupy in the client's console window.

srDestRegion_Top (2 bytes): A 2-byte unsigned integer field that specifies the y-coordinate of the upper-left corner of a rectangle in the server's console window. This MUST be a value between 0 and the bottom-most character position, inclusive, expressed as an offset from the top-most row that a character can occupy in the client's console window.

srDestRegion_Right (2 bytes): A 2-byte unsigned integer field that specifies the x-coordinate of the lower-right corner of a rectangle in the server's console window. This MUST be a value between 0 and the right-most character position, inclusive, expressed as an offset from the left-most column that a character can occupy.

srDestRegion_Bottom (2 bytes): A 2-byte unsigned integer field that specifies the y-coordinate of the lower-right corner of a rectangle in the server's console window. This MUST be a value between 0 and the bottom-most character position, inclusive, expressed as an offset from the top-most row that a character can occupy.

Vtnt_char_array (variable): Vtnt_char_array is a set of one or more VTNT_SINGLE_CHAR structures, that contains the input characters sent to the client.

The number of VTNT_SINGLE_CHAR structures in this array MUST be equal to the product of the coSizeOfData_x and coSizeOfData_y fields.

Characters MUST be arranged in the Vtnt_char_array array in row-major order. That is, the first VTNT_SINGLE_CHAR structure fills the first character position of the first row of the region identified for repainting, the second structures fill the second character position in the first row, and so on. Once all the character positions in the first row are filled, the next VTNT_SINGLE_CHAR structure contains the character at the first character position of the second row. This follows until all the character positions identified by the coordinates are filled. There MUST be no padding bytes before or after a VTNT_SINGLE_CHAR structure in the VTNT_CHAR_INFO structure.