6.1.12 Language-Specific Libraries

The translation tables for the language-specific libraries are in files that contain data in two segments: the CODE segment, which is load-on-call and discardable, and the DATA segment, which is fixed. Data from the CODE segment of the DLL is used to overlay the tables in the DATA segment of the main driver. Data in the DATA segment of the library is not copied; instead, a pointer in the driver is set to the library's DATA segment address.

The initial values in the tables in the library's DATA segment are for enhanced keyboards. For other keyboard types, the tables in the library's DATA segment must be patched or overlaid from tables in the CODE segment.

The GetKbdTable function performs the copying or overlaying. The driver calls the function after the driver loads the library. Once GetKbdTable is called, the driver accesses the library's fixed DATA segment directly. After initialization, the tables in the CODE segment of the library are no longer used.

A header, containing offsets and sizes of the various tables in the library's DATA segment, is always copied to the driver no matter what type of keyboard is installed.

Some language-specific libraries contain the function GetKeyString. The keyboard's GetKeyNameText function calls GetKeyString to obtain key name strings in the language appropriate to the keyboard.