Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

290 lines
11 KiB

  1. #define BYTES_PER_SECTOR 512
  2. #define SECTORS_PER_TRACK 18
  3. #define TRACK_SIZE (SECTORS_PER_TRACK * BYTES_PER_SECTOR)
  4. #define TRACKS_ON_DISK (80 * 2) // * 2 because it is double-sided
  5. #define CPCLASS_DEFAULT 99
  6. #define CPCLASS_EGA 0
  7. #define CPCLASS_EGA2 1
  8. #define CPCLASS_EGA3 2
  9. #define CPCLASS_EGA4 3
  10. #define CPCLASS_HEBEGA 4
  11. typedef struct {
  12. UINT iCP;
  13. UINT iClass;
  14. } CLASSFROMCP;
  15. const CLASSFROMCP rgCPtoClassMap[] =
  16. {{1258, CPCLASS_DEFAULT},
  17. {874, CPCLASS_DEFAULT},
  18. {932, CPCLASS_DEFAULT},
  19. {936, CPCLASS_DEFAULT},
  20. {949, CPCLASS_DEFAULT},
  21. {950, CPCLASS_DEFAULT},
  22. {708, CPCLASS_DEFAULT},
  23. {709, CPCLASS_DEFAULT},
  24. {710, CPCLASS_DEFAULT},
  25. {860, CPCLASS_DEFAULT},
  26. {861, CPCLASS_DEFAULT},
  27. {863, CPCLASS_DEFAULT},
  28. {864, CPCLASS_DEFAULT},
  29. {865, CPCLASS_DEFAULT},
  30. {850, CPCLASS_EGA},
  31. {852, CPCLASS_EGA},
  32. {437, CPCLASS_EGA},
  33. {869, CPCLASS_EGA2},
  34. {737, CPCLASS_EGA2},
  35. {857, CPCLASS_EGA2},
  36. {866, CPCLASS_EGA3},
  37. {775, CPCLASS_EGA3},
  38. {855, CPCLASS_EGA3},
  39. {720, CPCLASS_EGA4},
  40. {862, CPCLASS_HEBEGA}};
  41. #define KEYBOARD_US 0
  42. #define KEYBOARD_GR 1
  43. #define KEYBOARD_HE 2
  44. #define KEYBOARD_FR 3
  45. #define KEYBOARD_SP 4
  46. #define KEYBOARD_IT 5
  47. #define KEYBOARD_SV 6
  48. #define KEYBOARD_NL 7
  49. #define KEYBOARD_BR 8
  50. #define KEYBOARD_NO 9
  51. #define KEYBOARD_DK 10
  52. #define KEYBOARD_SU 11
  53. #define KEYBOARD_RU 12
  54. #define KEYBOARD_CZ 13
  55. #define KEYBOARD_PL 14
  56. #define KEYBOARD_HU 15
  57. #define KEYBOARD_PO 16
  58. #define KEYBOARD_TR 17
  59. #define KEYBOARD_GK 18
  60. #define KEYBOARD_BL 19
  61. #define KEYBOARD_BG 20
  62. #define KEYBOARD_YU 21
  63. #define KEYBOARD_BE 22
  64. #define KEYBOARD_CF 23
  65. #define KEYBOARD_UK 24
  66. #define KEYBOARD_ET 25
  67. #define KEYBOARD_SF 26
  68. #define KEYBOARD_SG 27
  69. #define KEYBOARD_IS 28
  70. #define KEYBOARD_IME 29
  71. #define KEYBOARD_RO 30
  72. #define KEYBOARD_YC 31
  73. #define KEYBOARD_LA 32
  74. #define KEYBOARD_UR 33
  75. #define KEYBOARD_SL 34
  76. typedef struct {
  77. WORD wLangId;
  78. UINT iKB;
  79. } KBFROMLANGID;
  80. const KBFROMLANGID rgLangIdtoKBMap[] =
  81. {{MAKELANGID(LANG_AFRIKAANS,0), KEYBOARD_US},
  82. {MAKELANGID(LANG_ALBANIAN,0), KEYBOARD_US},
  83. {0x45e, KEYBOARD_US}, // AMHARIC
  84. {MAKELANGID(LANG_ARABIC,0), KEYBOARD_US},
  85. {MAKELANGID(LANG_ARMENIAN,0), KEYBOARD_US},
  86. {MAKELANGID(LANG_ASSAMESE,0), KEYBOARD_US},
  87. {MAKELANGID(LANG_AZERI,0), KEYBOARD_US},
  88. {MAKELANGID(LANG_BASQUE,0), KEYBOARD_SP},
  89. {MAKELANGID(LANG_BELARUSIAN,0), KEYBOARD_BL},
  90. {MAKELANGID(LANG_BENGALI,0), KEYBOARD_US},
  91. {0x101a, KEYBOARD_US}, // BOSNIA/HERZEGOVINA
  92. {MAKELANGID(LANG_BULGARIAN,0), KEYBOARD_BG},
  93. {0x455, KEYBOARD_US}, // BURMESE
  94. {MAKELANGID(LANG_CATALAN,0), KEYBOARD_SP},
  95. {0x45c, KEYBOARD_US}, // CHEROKEE
  96. {MAKELANGID(LANG_CHINESE,0), KEYBOARD_US},
  97. {MAKELANGID(LANG_CROATIAN,0), KEYBOARD_YU},
  98. {0x450, KEYBOARD_US}, // CYRILLIC
  99. {MAKELANGID(LANG_CZECH,0), KEYBOARD_CZ},
  100. {MAKELANGID(LANG_DANISH,0), KEYBOARD_DK},
  101. {MAKELANGID(LANG_DUTCH,0), KEYBOARD_NL},
  102. {MAKELANGID(LANG_DUTCH,SUBLANG_DUTCH_BELGIAN), KEYBOARD_BE},
  103. {MAKELANGID(LANG_ENGLISH,0), KEYBOARD_US},
  104. {0x4409, KEYBOARD_US}, // ENGLISH / MALAYSIA
  105. {MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_UK), KEYBOARD_UK},
  106. {MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_CAN), KEYBOARD_CF},
  107. {MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_EIRE), KEYBOARD_UK},
  108. {0x1809, KEYBOARD_UK}, // ENGLISH / IRELAND
  109. {MAKELANGID(LANG_ESTONIAN,0), KEYBOARD_ET},
  110. {MAKELANGID(LANG_FAEROESE,0), KEYBOARD_DK},
  111. {MAKELANGID(LANG_FARSI,0), KEYBOARD_US},
  112. {MAKELANGID(LANG_FINNISH,0), KEYBOARD_SU},
  113. {MAKELANGID(LANG_FRENCH,0), KEYBOARD_FR},
  114. {MAKELANGID(LANG_FRENCH,SUBLANG_FRENCH_BELGIAN), KEYBOARD_BE},
  115. {MAKELANGID(LANG_FRENCH,SUBLANG_FRENCH_CANADIAN), KEYBOARD_CF},
  116. {MAKELANGID(LANG_FRENCH,SUBLANG_FRENCH_SWISS), KEYBOARD_SF},
  117. {0x462, KEYBOARD_US}, // FRISIAN
  118. {0x83c, KEYBOARD_UK}, // GAELIC / IRELAND
  119. {0x43c, KEYBOARD_UK}, // GAELIC / SCOTLAND
  120. {0x456, KEYBOARD_SP}, // GALICIAN
  121. {MAKELANGID(LANG_GEORGIAN,0), KEYBOARD_US},
  122. {MAKELANGID(LANG_GERMAN,0), KEYBOARD_GR},
  123. {MAKELANGID(LANG_GERMAN,SUBLANG_GERMAN_SWISS), KEYBOARD_SG},
  124. {MAKELANGID(LANG_GREEK,0), KEYBOARD_GK},
  125. {MAKELANGID(LANG_GUJARATI,0), KEYBOARD_US},
  126. {MAKELANGID(LANG_HEBREW,0), KEYBOARD_HE},
  127. {MAKELANGID(LANG_HINDI,0), KEYBOARD_US},
  128. {MAKELANGID(LANG_HUNGARIAN,0), KEYBOARD_HU},
  129. {MAKELANGID(LANG_ICELANDIC,0), KEYBOARD_IS},
  130. {MAKELANGID(LANG_INDONESIAN,0), KEYBOARD_US},
  131. {0x45e, KEYBOARD_US}, // INUKITUT
  132. {MAKELANGID(LANG_ITALIAN,0), KEYBOARD_IT},
  133. {MAKELANGID(LANG_JAPANESE,0), KEYBOARD_IME},
  134. {MAKELANGID(LANG_KANNADA,0), KEYBOARD_US},
  135. {MAKELANGID(LANG_KASHMIRI,0), KEYBOARD_US},
  136. {MAKELANGID(LANG_KAZAK,0), KEYBOARD_US},
  137. {0x453, KEYBOARD_US}, // KHMER
  138. {0x440, KEYBOARD_US}, // KIRGHIZ
  139. {MAKELANGID(LANG_KONKANI,0), KEYBOARD_US},
  140. {MAKELANGID(LANG_KOREAN,0), KEYBOARD_IME},
  141. {0x454, KEYBOARD_US}, // LAO
  142. {0x464, KEYBOARD_US}, // LATIN (VATICAN)
  143. {MAKELANGID(LANG_LATVIAN,0), KEYBOARD_US},
  144. {MAKELANGID(LANG_LITHUANIAN,0), KEYBOARD_US},
  145. {MAKELANGID(LANG_MACEDONIAN,0), KEYBOARD_US},
  146. {MAKELANGID(LANG_MALAY,0), KEYBOARD_US},
  147. {MAKELANGID(LANG_MALAYALAM,0), KEYBOARD_US},
  148. {0x43e, KEYBOARD_US}, // MALAYSIAN
  149. {0x43a, KEYBOARD_US}, // MALTESE
  150. {MAKELANGID(LANG_MANIPURI,0), KEYBOARD_US},
  151. {MAKELANGID(LANG_MARATHI,0), KEYBOARD_US},
  152. {0x850, KEYBOARD_US}, // MONGOLIAN
  153. {MAKELANGID(LANG_NEPALI,0), KEYBOARD_US},
  154. {MAKELANGID(LANG_NEUTRAL,0), KEYBOARD_US},
  155. {MAKELANGID(LANG_NORWEGIAN,0), KEYBOARD_NO},
  156. {MAKELANGID(LANG_ORIYA,0), KEYBOARD_US},
  157. {0x463, KEYBOARD_US}, // PASHTO
  158. {MAKELANGID(LANG_POLISH,0), KEYBOARD_PL},
  159. {MAKELANGID(LANG_PORTUGUESE,0), KEYBOARD_PO},
  160. {MAKELANGID(LANG_PORTUGUESE,SUBLANG_PORTUGUESE_BRAZILIAN), KEYBOARD_BR},
  161. {MAKELANGID(LANG_PUNJABI,0), KEYBOARD_US},
  162. {0x417, KEYBOARD_US}, // RHAETO-ROMANIC
  163. {MAKELANGID(LANG_ROMANIAN,0), KEYBOARD_RO},
  164. {MAKELANGID(LANG_RUSSIAN,0), KEYBOARD_RU},
  165. {0x43b, KEYBOARD_US}, // SAMI (LAPPISH)
  166. {MAKELANGID(LANG_SANSKRIT,0), KEYBOARD_US},
  167. {MAKELANGID(LANG_SERBIAN,0), KEYBOARD_YC},
  168. {MAKELANGID(LANG_SERBIAN,SUBLANG_SERBIAN_CYRILLIC), KEYBOARD_YC},
  169. {MAKELANGID(LANG_SERBIAN,SUBLANG_SERBIAN_LATIN), KEYBOARD_YU},
  170. {MAKELANGID(LANG_SINDHI,0), KEYBOARD_US},
  171. {0x45b, KEYBOARD_US}, // SINHALESE
  172. {MAKELANGID(LANG_SLOVAK,0), KEYBOARD_SL},
  173. {MAKELANGID(LANG_SLOVENIAN,0), KEYBOARD_YU},
  174. {0x42e, KEYBOARD_US}, // SORBIAN
  175. {MAKELANGID(LANG_SPANISH,0), KEYBOARD_SP},
  176. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_ARGENTINA), KEYBOARD_LA},
  177. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_BOLIVIA), KEYBOARD_LA},
  178. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_CHILE), KEYBOARD_LA},
  179. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_COLOMBIA), KEYBOARD_LA},
  180. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_COSTA_RICA), KEYBOARD_LA},
  181. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_DOMINICAN_REPUBLIC), KEYBOARD_LA},
  182. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_ECUADOR), KEYBOARD_LA},
  183. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_EL_SALVADOR), KEYBOARD_LA},
  184. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_GUATEMALA), KEYBOARD_LA},
  185. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_HONDURAS), KEYBOARD_LA},
  186. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_MEXICAN), KEYBOARD_LA},
  187. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_NICARAGUA), KEYBOARD_LA},
  188. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_PANAMA), KEYBOARD_LA},
  189. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_PARAGUAY), KEYBOARD_LA},
  190. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_PERU), KEYBOARD_LA},
  191. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_PUERTO_RICO), KEYBOARD_LA},
  192. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_MODERN), KEYBOARD_SP},
  193. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_URUGUAY), KEYBOARD_LA},
  194. {MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_VENEZUELA), KEYBOARD_LA},
  195. {0x430, KEYBOARD_US}, // SUTU
  196. {MAKELANGID(LANG_SWAHILI,0), KEYBOARD_US},
  197. {MAKELANGID(LANG_SWEDISH,0), KEYBOARD_SV},
  198. {0x45a, KEYBOARD_US}, // SYRIAC
  199. {0x428, KEYBOARD_US}, // TAJIK
  200. {MAKELANGID(LANG_TAMIL,0), KEYBOARD_US},
  201. {MAKELANGID(LANG_TATAR,0), KEYBOARD_US},
  202. {MAKELANGID(LANG_TELUGU,0), KEYBOARD_US},
  203. {MAKELANGID(LANG_THAI,0), KEYBOARD_US},
  204. {0x451, KEYBOARD_US}, // TIBETAN
  205. {0x431, KEYBOARD_US}, // TSONGA
  206. {0x432, KEYBOARD_US}, // TSWANA
  207. {MAKELANGID(LANG_TURKISH,0), KEYBOARD_TR},
  208. {0x442, KEYBOARD_US}, // TURKMEN
  209. {MAKELANGID(LANG_UKRAINIAN,0), KEYBOARD_UR},
  210. {MAKELANGID(LANG_URDU,0), KEYBOARD_US},
  211. {MAKELANGID(LANG_UZBEK,0), KEYBOARD_US},
  212. {0x433, KEYBOARD_US}, // VENDA
  213. {MAKELANGID(LANG_VIETNAMESE,0), KEYBOARD_US},
  214. {0x452, KEYBOARD_US}, // WELSH
  215. {0x434, KEYBOARD_US}, // XHOSA
  216. {0x43d, KEYBOARD_US}, // YIDDISH
  217. {0x435, KEYBOARD_US}};// ZULU
  218. #define KBCLASS_1 0
  219. #define KBCLASS_2 1
  220. #define KBCLASS_3 2
  221. #define KBCLASS_4 3
  222. #define KBCLASS_BLANK 99
  223. typedef struct {
  224. UINT iKB;
  225. UINT iClass;
  226. } CLASSFROMKB;
  227. const CLASSFROMKB rgKBtoClassMap[] =
  228. {{KEYBOARD_US, KBCLASS_BLANK},
  229. {KEYBOARD_GR, KBCLASS_1},
  230. {KEYBOARD_HE, KBCLASS_4},
  231. {KEYBOARD_FR, KBCLASS_1},
  232. {KEYBOARD_SP, KBCLASS_1},
  233. {KEYBOARD_IT, KBCLASS_1},
  234. {KEYBOARD_SV, KBCLASS_1},
  235. {KEYBOARD_NL, KBCLASS_1},
  236. {KEYBOARD_BR, KBCLASS_1},
  237. {KEYBOARD_NO, KBCLASS_1},
  238. {KEYBOARD_DK, KBCLASS_1},
  239. {KEYBOARD_SU, KBCLASS_1},
  240. {KEYBOARD_RU, KBCLASS_3},
  241. {KEYBOARD_CZ, KBCLASS_2},
  242. {KEYBOARD_PL, KBCLASS_4},
  243. {KEYBOARD_HU, KBCLASS_2},
  244. {KEYBOARD_PO, KBCLASS_1},
  245. {KEYBOARD_TR, KBCLASS_2},
  246. {KEYBOARD_GK, KBCLASS_4},
  247. {KEYBOARD_BL, KBCLASS_3},
  248. {KEYBOARD_BG, KBCLASS_2},
  249. {KEYBOARD_YU, KBCLASS_2},
  250. {KEYBOARD_BE, KBCLASS_1},
  251. {KEYBOARD_CF, KBCLASS_2},
  252. {KEYBOARD_UK, KBCLASS_1},
  253. {KEYBOARD_ET, KBCLASS_4},
  254. {KEYBOARD_SF, KBCLASS_1},
  255. {KEYBOARD_SG, KBCLASS_1},
  256. {KEYBOARD_IS, KBCLASS_2},
  257. {KEYBOARD_IME,KBCLASS_1},
  258. {KEYBOARD_RO, KBCLASS_2},
  259. {KEYBOARD_YC, KBCLASS_2},
  260. {KEYBOARD_LA, KBCLASS_1},
  261. {KEYBOARD_UR, KBCLASS_3},
  262. {KEYBOARD_SL, KBCLASS_2}};