Windows initializes the keyboard driver by calling the driver's initialization routine when it first loads the driver. Windows also calls the driver's InquireEx function to retrieve information about the driver. When Windows calls InquireEx with the INQEX_KBDINFO flag, the driver must fill a KBINFO structure with information used to support double-byte character sets (DBCS). The function also specifies the number of bytes of key-state information that Windows must support (that is, the size of the state block). The ToAsciiEx function fills the state block when Windows calls the function to translate scan codes to ANSI character codes.
For more information about your keyboard and ROM BIOS, see the documentation from your computer manufacturer.
InquireEx, KBINFO, ToAsciiEx