Source code of Windows XP (NT5)
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.

375 lines
9.9 KiB

  1. This file details an interface to be used to supply locale/language-specific
  2. function for display, keyboard handling, etc, within text setup.
  3. The goals are as follows:
  4. 1) Provide a straightforward means for supporting fully localized text display,
  5. keyboard handling, and other features, in various locales, especially
  6. Far Eastern ones.
  7. 2) Avoid impacting setupdd.sys's size or performance when such function is not
  8. required.
  9. To this end features such as DBCS font support, locale-specific keyboard detection,
  10. and various other features are to be removed and placed into an export driver.
  11. Setupdd.sys will be linked such that this driver is automatically referenced
  12. and loaded when setupdd.sys is loaded. Setupdd.sys will itself export a set of
  13. routines for use by the language-specific driver when carrying out its function.
  14. Language-specific drivers will be built in the setup\textmode\spddlang directory.
  15. Such drivers are logically part of setupdd.sys. No special set of include files
  16. will be created for the interfaces below; they will be contained in various
  17. header files in setup\textmode\kernel. Language-specific drivers' SOURCES files
  18. should be set up so they include setup\textmode\kernel in their INCLUDES and
  19. #include spprecmp.h.
  20. *******************************************************************************
  21. The functions listed below must be exported from every language-specific driver.
  22. NTSTATUS
  23. SplangInitializeFontSupport(
  24. IN PCWSTR BootDevicePath,
  25. IN PCWSTR DirectoryOnBootDevice
  26. );
  27. /*++
  28. Routine Description:
  29. This routine is called by setupdd.sys to allow the language-specific
  30. font support to be initialized. The language-specific driver should
  31. load any font it requires and perform any additioanl initialization.
  32. Arguments:
  33. BootDevicePath - supplies the path of the device from which the system
  34. booted. This is a full NT-style path that includes a directory spec.
  35. DirectoryOnBootDevice - supplies directory relative to root of boot
  36. device.
  37. Return Value:
  38. NT Status code indicating outcome. If this routine returns a non-success
  39. status code, then setupdd.sys will not switch into non-US character mode.
  40. The implementation of this routine is free to call SpBugCheck or otherwise
  41. inform the user of any errors if it wishes to halt setup if font
  42. initialization fails.
  43. --*/
  44. NTSTATUS
  45. SplangTerminateFontSupport(
  46. VOID
  47. );
  48. /*++
  49. Routine Description:
  50. This routine may be called in certain conditions to cause font support
  51. for a particular language to be terminated. The implementation should
  52. clean up any resources allocated during SplangInitializeFontSupport().
  53. Arguments:
  54. None.
  55. Return Value:
  56. NT Status code indicating outcome.
  57. --*/
  58. PVIDEO_FUNCTION_VECTOR
  59. SplangGetVideoFunctionVector(
  60. IN SpVideoType VideoType,
  61. IN PSP_VIDEO_VARS VideoVariableBlock
  62. );
  63. /*++
  64. Routine Description:
  65. This routine is called by setupdd.sys upon successful return from
  66. SplangInitializeFontSupport, to request a pointer to a vector of
  67. language-specific display support routines for a given display
  68. type (vga or frame buffer).
  69. Arguments:
  70. VideoType - a value from the SpVideoType enum indicating which display
  71. vector is requested. Currently one of SpVideoVga or SpVideoFrameBuffer.
  72. VideoVariableBlock - supplies a pointer to a block of video variables that
  73. are shared between the high-level code in setup\textmode\spvideo.c and
  74. the display-specific code.
  75. Return Value:
  76. Pointer to the language-specific video functions vector to use for
  77. displaying text. NULL if the requested type is not supported. In this case
  78. the display will not be switched into non-US character mode.
  79. --*/
  80. ULONG
  81. SplangGetColumnCount(
  82. IN PCWSTR String
  83. );
  84. /*++
  85. Routine Description:
  86. This routine is called by setupdd.sys to determine how many columns
  87. on the screen a particular string will occupy. This may be different
  88. than the number of characters in the string due to full/half width
  89. characters in the character set, etc. Full width chars occupy two columns
  90. whereas half-width chars occupy one column. If the font in use is
  91. fixed-pitch or does not support DBCS, the number of columns is by
  92. definition equal to the number of characters in the string.
  93. Arguments:
  94. String - points to unicode string whose width in columns is desired.
  95. Return Value:
  96. Number of columns occupied by the string.
  97. --*/
  98. PWSTR
  99. SplangPadString(
  100. IN int Size,
  101. IN PCWSTR String
  102. );
  103. /*++
  104. Routine Description:
  105. This routine is called by setupdd.sys to generate a padded string
  106. appropriate for SBCS or DBCS as appropriate.
  107. Arguments:
  108. Size - specifies the length to which to pad the string.
  109. String - points to unicode string that needs to be padded.
  110. Return Value:
  111. Pointer to padded string. Note that this is a static buffer and thus
  112. the caller must duplicate the string if it is needed across multiple
  113. calls to this routine.
  114. --*/
  115. VOID
  116. SplangSelectKeyboard(
  117. IN BOOLEAN UnattendedMode,
  118. IN PVOID SifHandle,
  119. IN PHARDWARE_COMPONENT *HwComponents
  120. );
  121. /*++
  122. Routine Description:
  123. This routine is called by setupdd.sys to allow language-specific processing
  124. for the keyboard selection. The implementation can confirm a keyboard
  125. type at this time.
  126. Arguments:
  127. UnattendedMode - supplies a flag indicating whether we are running in
  128. unattended mode. If so, the implementation may wish to do nothing,
  129. since the user will not be entering any paths.
  130. SifHandle - supplies handle to open setup information file (txtsetup.sif).
  131. HwComponents - supplies the address of the master hardware components
  132. array.
  133. Return Value:
  134. None. If a failure occurs, it is up to the implementation to decide whether
  135. to continue or to SpBugCheck.
  136. --*/
  137. VOID
  138. SplangReinitializeKeyboard(
  139. IN BOOLEAN UnattendedMode,
  140. IN PVOID SifHandle,
  141. IN PWSTR Directory,
  142. OUT PVOID *KeyboardVector,
  143. IN PHARDWARE_COMPONENT *HwComponents
  144. );
  145. /*++
  146. Routine Description:
  147. This routine is called by setupdd.sys to allow language-specific processing
  148. for the keyboard. The implementation can reinitialize the keyboard layout
  149. at this time.
  150. This routine will be called before the user is asked to enter any paths
  151. or other text that includes typing anything other than keys such as
  152. ENTER, function keys, backspace, escape, etc.
  153. Arguments:
  154. UnattendedMode - supplies a flag indicating whether we are running in
  155. unattended mode. If so, the implementation may wish to do nothing,
  156. since the user will not be entering any paths.
  157. SifHandle - supplies handle to open setup information file (txtsetup.sif).
  158. Directory - supplies the directory on the boot device from which the
  159. new layout dll is to be loaded.
  160. KeyboardVector - supplies the address of a pointer to the keyboard
  161. vector table. The implementation should overwrite this value with
  162. whatever is returned from SpLoadKbdLayoutDll().
  163. HwComponents - supplies the address of the master hardware components
  164. array.
  165. Return Value:
  166. None. If a failure occurs the implementation must leave the currently active
  167. keybaord in place.
  168. --*/
  169. WCHAR
  170. SplangGetLineDrawChar(
  171. IN LineCharIndex WhichChar
  172. );
  173. /*++
  174. Routine Description:
  175. This routine is called by setupdd.sys to retreive the unicode value for
  176. a particular line drawing character. An implementation must make these
  177. characters available in the character set somehow.
  178. Arguments:
  179. WhichChar - supplies the index of the character desired.
  180. Return Value:
  181. Unicode value for the character in question. Because the character
  182. will be displayed using the language-specific module, the implementation
  183. can materialize this character by playing whatever tricks it needs to,
  184. such as overlaying a hardcoded glyph into the character set, etc.
  185. --*/
  186. WCHAR
  187. SplangGetCursorChar(
  188. VOID
  189. );
  190. /*++
  191. Routine Description:
  192. This routine is called by setupdd.sys to retreive the unicode value
  193. of a character to be used as the cursor when the user is asked to
  194. enter text.
  195. Arguments:
  196. None.
  197. Return Value:
  198. Unicode value for the character to be used as the cursor.
  199. --*/
  200. NTSTATUS
  201. SplangSetRegistryData(
  202. IN PVOID SifHandle,
  203. IN HANDLE ControlSetKeyHandle,
  204. IN PHARDWARE_COMPONENT *HwComponents
  205. );
  206. /*++
  207. Routine Description:
  208. This routine is called by setupdd.sys to cause language-specific
  209. information to be written into the current control set in the registry.
  210. Arguments:
  211. SifHandle - supplies a handle to the open setup information file
  212. (txtsetup.sif).
  213. ControlSetKeyHandle - supplies a handle to the current control set
  214. root in the registry (ie, HKEY_LOCAL_MACHINE\CurrentControlSet).
  215. HwComponents - supplies the address of the master hardware components
  216. array.
  217. Return Value:
  218. NT Status value indicating outcome. A non-success status is considered
  219. critical and causes Setup to abort.
  220. --*/
  221. BOOLEAN
  222. SplangQueryMinimizeExtraSpacing(
  223. VOID
  224. );
  225. /*++
  226. Routine Description:
  227. This routine is called by setupdd.sys to determine whether to
  228. eliminate uses of extra spacing on the screen to set off things
  229. like menus and lists from text. Languages whose text takes up
  230. a lot of room on the screen might opt to eliminate such spacing
  231. to allow menus to display more than a couple of items at a time, etc.
  232. The return value affects numerous screens, such as the partition menu,
  233. upgrade lists, etc.
  234. Arguments:
  235. None.
  236. Return Value:
  237. Boolean value indicating whether the implementation wants unnecessary
  238. spaces eliminated when text, menu, etc, are displayed.
  239. --*/
  240. *******************************************************************************
  241. The functions listed below are exported from setupdd.sys for use by
  242. language-specific drivers. Such drivers are free to use any NT API normally
  243. available to NT device drivers in addition to the routines listed below.
  244.