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.

330 lines
8.7 KiB

  1. /*++
  2. Copyright (c) 1985 - 1999, Microsoft Corporation
  3. Module Name:
  4. dispatch.h
  5. Abstract:
  6. Author:
  7. KazuM Apr.19.1996
  8. Revision History:
  9. --*/
  10. #undef WWSB
  11. #if defined(WWSB_NOFE)
  12. #define WWSB(fn) SB_##fn
  13. #elif defined(WWSB_FE)
  14. #define WWSB(fn) FE_##fn
  15. #else
  16. #define WWSB(fn) fn
  17. #endif
  18. NTSTATUS
  19. WWSB(DoSrvWriteConsole)(
  20. IN OUT PCSR_API_MSG m,
  21. IN OUT PCSR_REPLY_STATUS ReplyStatus,
  22. IN PCONSOLE_INFORMATION Console,
  23. IN PHANDLE_DATA HandleData
  24. );
  25. NTSTATUS
  26. WWSB(WriteOutputString)(
  27. IN PSCREEN_INFORMATION ScreenInfo,
  28. IN PVOID Buffer,
  29. IN COORD WriteCoord,
  30. IN ULONG StringType,
  31. IN OUT PULONG NumRecords, // this value is valid even for error cases
  32. OUT PULONG NumColumns OPTIONAL
  33. );
  34. VOID
  35. WWSB(WriteRectToScreenBuffer)(
  36. PBYTE Source,
  37. COORD SourceSize,
  38. PSMALL_RECT SourceRect,
  39. PSCREEN_INFORMATION ScreenInfo,
  40. COORD TargetPoint,
  41. IN UINT Codepage
  42. );
  43. VOID
  44. WWSB(WriteToScreen)(
  45. IN PSCREEN_INFORMATION ScreenInfo,
  46. PSMALL_RECT Region // region is inclusive
  47. );
  48. VOID
  49. WWSB(WriteRegionToScreen)(
  50. IN PSCREEN_INFORMATION ScreenInfo,
  51. IN PSMALL_RECT Region
  52. );
  53. NTSTATUS
  54. WWSB(FillOutput)(
  55. IN PSCREEN_INFORMATION ScreenInfo,
  56. IN WORD Element,
  57. IN COORD WriteCoord,
  58. IN ULONG ElementType,
  59. IN OUT PULONG Length // this value is valid even for error cases
  60. );
  61. VOID
  62. WWSB(FillRectangle)(
  63. IN CHAR_INFO Fill,
  64. IN OUT PSCREEN_INFORMATION ScreenInfo,
  65. IN PSMALL_RECT TargetRect
  66. );
  67. ULONG
  68. WWSB(DoWriteConsole)(
  69. IN OUT PCSR_API_MSG m,
  70. IN PCONSOLE_INFORMATION Console,
  71. IN PCSR_THREAD Thread
  72. );
  73. NTSTATUS
  74. WWSB(WriteChars)(
  75. IN PSCREEN_INFORMATION ScreenInfo,
  76. IN PWCHAR lpBufferBackupLimit,
  77. IN PWCHAR lpBuffer,
  78. IN PWCHAR lpRealUnicodeString,
  79. IN OUT PDWORD NumBytes,
  80. OUT PLONG NumSpaces OPTIONAL,
  81. IN SHORT OriginalXPosition,
  82. IN DWORD dwFlags,
  83. OUT PSHORT ScrollY OPTIONAL
  84. );
  85. NTSTATUS
  86. WWSB(AdjustCursorPosition)(
  87. IN PSCREEN_INFORMATION ScreenInfo,
  88. IN COORD CursorPosition,
  89. IN BOOL KeepCursorVisible,
  90. OUT PSHORT ScrollY OPTIONAL
  91. );
  92. NTSTATUS
  93. TranslateOutputToAnsiUnicode(
  94. IN PCONSOLE_INFORMATION Console,
  95. IN OUT PCHAR_INFO OutputBuffer,
  96. IN COORD Size,
  97. IN OUT PCHAR_INFO OutputBufferR
  98. );
  99. NTSTATUS
  100. FE_TranslateOutputToAnsiUnicode(
  101. IN PCONSOLE_INFORMATION Console,
  102. IN OUT PCHAR_INFO OutputBuffer,
  103. IN COORD Size,
  104. IN OUT PCHAR_INFO OutputBufferR
  105. );
  106. NTSTATUS
  107. SB_TranslateOutputToAnsiUnicode(
  108. IN PCONSOLE_INFORMATION Console,
  109. IN OUT PCHAR_INFO OutputBuffer,
  110. IN COORD Size
  111. );
  112. NTSTATUS
  113. WWSB(TranslateOutputToUnicode)(
  114. IN PCONSOLE_INFORMATION Console,
  115. IN OUT PCHAR_INFO OutputBuffer,
  116. IN COORD Size);
  117. NTSTATUS
  118. TranslateOutputToOemUnicode(
  119. IN PCONSOLE_INFORMATION Console,
  120. IN OUT PCHAR_INFO OutputBuffer,
  121. IN COORD Size,
  122. IN BOOL fRemoveDbcsMark
  123. );
  124. NTSTATUS
  125. FE_TranslateOutputToOemUnicode(
  126. IN PCONSOLE_INFORMATION Console,
  127. IN OUT PCHAR_INFO OutputBuffer,
  128. IN COORD Size,
  129. IN BOOL fRemoveDbcsMark
  130. );
  131. NTSTATUS
  132. SB_TranslateOutputToOemUnicode(
  133. IN PCONSOLE_INFORMATION Console,
  134. IN OUT PCHAR_INFO OutputBuffer,
  135. IN COORD Size
  136. );
  137. NTSTATUS
  138. WWSB(TranslateOutputToOem)(
  139. IN PCONSOLE_INFORMATION Console,
  140. IN OUT PCHAR_INFO OutputBuffer,
  141. IN COORD Size
  142. );
  143. ULONG
  144. TranslateInputToUnicode(
  145. IN PCONSOLE_INFORMATION Console,
  146. IN OUT PINPUT_RECORD InputRecords,
  147. IN ULONG NumRecords,
  148. IN OUT PINPUT_RECORD DBCSLeadByte
  149. );
  150. ULONG
  151. FE_TranslateInputToUnicode(
  152. IN PCONSOLE_INFORMATION Console,
  153. IN OUT PINPUT_RECORD InputRecords,
  154. IN ULONG NumRecords,
  155. IN OUT PINPUT_RECORD DBCSLeadByte
  156. );
  157. ULONG
  158. SB_TranslateInputToUnicode(
  159. IN PCONSOLE_INFORMATION Console,
  160. IN OUT PINPUT_RECORD InputRecords,
  161. IN ULONG NumRecords
  162. );
  163. ULONG
  164. TranslateInputToOem(
  165. IN PCONSOLE_INFORMATION Console,
  166. IN OUT PINPUT_RECORD InputRecords,
  167. IN ULONG NumRecords, // in : ASCII byte count
  168. IN ULONG UnicodeLength, // in : Number of events (char count)
  169. OUT PINPUT_RECORD DbcsLeadInpRec
  170. );
  171. ULONG
  172. FE_TranslateInputToOem(
  173. IN PCONSOLE_INFORMATION Console,
  174. IN OUT PINPUT_RECORD InputRecords,
  175. IN ULONG NumRecords, // in : ASCII byte count
  176. IN ULONG UnicodeLength, // in : Number of events (char count)
  177. OUT PINPUT_RECORD DbcsLeadInpRec
  178. );
  179. ULONG
  180. SB_TranslateInputToOem(
  181. IN PCONSOLE_INFORMATION Console,
  182. IN OUT PINPUT_RECORD InputRecords,
  183. IN ULONG NumRecords
  184. );
  185. #ifdef i386
  186. VOID
  187. WWSB(WriteRegionToScreenHW)(
  188. IN PSCREEN_INFORMATION ScreenInfo,
  189. IN PSMALL_RECT Region
  190. );
  191. #endif
  192. VOID
  193. StreamWriteToScreenBuffer(
  194. IN PWCHAR String,
  195. IN SHORT StringLength,
  196. IN PSCREEN_INFORMATION ScreenInfo
  197. );
  198. VOID
  199. FE_StreamWriteToScreenBuffer(
  200. IN PWCHAR String,
  201. IN SHORT StringLength,
  202. IN PSCREEN_INFORMATION ScreenInfo,
  203. IN PCHAR StringA
  204. );
  205. VOID
  206. SB_StreamWriteToScreenBuffer(
  207. IN PWCHAR String,
  208. IN SHORT StringLength,
  209. IN PSCREEN_INFORMATION ScreenInfo
  210. );
  211. /*
  212. * SB/FE neutral defines for use from _stream.h and _output.h
  213. *
  214. * Each of these functions appears in dispatch.c, but we don't want SB_ or FE_
  215. * routines to call the dispatching subroutines, we want to call the SB_ or FE_
  216. * subroutines directly. eg: There should be no calls to WriteChars from
  217. * anywhere in _stream.h : instead, we should call WWSB_WriteChars (etc.)
  218. */
  219. #if defined(WWSB_NOFE)
  220. #define WWSB_WriteChars SB_WriteChars
  221. #define WWSB_AdjustCursorPosition SB_AdjustCursorPosition
  222. #define WWSB_DoWriteConsole SB_DoWriteConsole
  223. #define WWSB_DoSrvWriteConsole SB_DoSrvWriteConsole
  224. #define WWSB_WriteToScreen SB_WriteToScreen
  225. #define WWSB_WriteOutputString SB_WriteOutputString
  226. #define WWSB_FillOutput SB_FillOutput
  227. #define WWSB_FillRectangle SB_FillRectangle
  228. #define WWSB_PolyTextOutCandidate SB_PolyTextOutCandidate
  229. #define WWSB_ConsolePolyTextOut SB_ConsolePolyTextOut
  230. #define WWSB_WriteRegionToScreen SB_WriteRegionToScreen
  231. #define WWSB_WriteRegionToScreenHW SB_WriteRegionToScreenHW
  232. #define WWSB_WriteRectToScreenBuffer SB_WriteRectToScreenBuffer
  233. #endif
  234. #if defined(WWSB_FE)
  235. #undef WWSB_WriteChars
  236. #define WWSB_WriteChars FE_WriteChars
  237. #undef WWSB_AdjustCursorPosition
  238. #define WWSB_AdjustCursorPosition FE_AdjustCursorPosition
  239. #undef WWSB_DoWriteConsole
  240. #define WWSB_DoWriteConsole FE_DoWriteConsole
  241. #undef WWSB_DoSrvWriteConsole
  242. #define WWSB_DoSrvWriteConsole FE_DoSrvWriteConsole
  243. #undef WWSB_WriteToScreen
  244. #define WWSB_WriteToScreen FE_WriteToScreen
  245. #undef WWSB_WriteOutputString
  246. #define WWSB_WriteOutputString FE_WriteOutputString
  247. #undef WWSB_FillOutput
  248. #define WWSB_FillOutput FE_FillOutput
  249. #undef WWSB_FillRectangle
  250. #define WWSB_FillRectangle FE_FillRectangle
  251. #undef WWSB_PolyTextOutCandidate
  252. #define WWSB_PolyTextOutCandidate FE_PolyTextOutCandidate
  253. #undef WWSB_ConsolePolyTextOut
  254. #define WWSB_ConsolePolyTextOut FE_ConsolePolyTextOut
  255. #undef WWSB_WriteRegionToScreen
  256. #define WWSB_WriteRegionToScreen FE_WriteRegionToScreen
  257. #undef WWSB_WriteRegionToScreenHW
  258. #define WWSB_WriteRegionToScreenHW FE_WriteRegionToScreenHW
  259. #undef WWSB_WriteRectToScreenBuffer
  260. #define WWSB_WriteRectToScreenBuffer FE_WriteRectToScreenBuffer
  261. #endif
  262. /*
  263. * define WWSB_NEUTRAL_FILE in _stream.h _output.h and _priv.h
  264. * This will guard against calling the dispatching versions when we can just
  265. * call the underlying FE_ or SB_ routine directly.
  266. */
  267. #ifdef WWSB_NEUTRAL_FILE
  268. #define WriteChars Should_not_call_WriteChars
  269. #define AdjustCursorPosition Should_not_call_AdjustCursorPosition
  270. #define DoWriteConsole Should_not_call_DoWriteConsole
  271. #define DoSrvWriteConsole Should_not_call_DoSrvWriteConsole
  272. #define WriteToScreen Should_not_call_WriteToScreen
  273. #define WriteOutputString Should_not_call_WriteOutputString
  274. #define FillOutput Should_not_call_FillOutput
  275. #define FillRectangle Should_not_call_FillRectangle
  276. #define PolyTextOutCandidate Should_not_call_PolyTextOutCandidate
  277. #define ConsolePolyTextOut Should_not_call_ConsolePolyTextOut
  278. #define WriteRegionToScreen Should_not_call_WriteRegionToScreen
  279. #define WriteRegionToScreenHW Should_not_call_WriteRegionToScreenHW
  280. #define WriteRectToScreenBuffer Should_not_call_WriteRectToScreenBuffer
  281. #endif