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.

2310 lines
43 KiB

  1. /*++
  2. Copyright (c) 1985 - 1999, Microsoft Corporation
  3. Module Name:
  4. consrv.h
  5. Abstract:
  6. This module contains the include files and definitions for the
  7. console server DLL.
  8. Author:
  9. Therese Stowell (thereses) 16-Nov-1990
  10. Revision History:
  11. --*/
  12. #if DBG && defined(DEBUG_PRINT)
  13. #define _DBGFONTS 0x00000001
  14. #define _DBGFONTS2 0x00000002
  15. #define _DBGCHARS 0x00000004
  16. #define _DBGOUTPUT 0x00000008
  17. #define _DBGFULLSCR 0x00000010
  18. #define _DBGALL 0xFFFFFFFF
  19. extern ULONG gDebugFlag;
  20. #define DBGFONTS(_params_) {if (gDebugFlag & _DBGFONTS) DbgPrint _params_ ; }
  21. #define DBGFONTS2(_params_) {if (gDebugFlag & _DBGFONTS2) DbgPrint _params_ ; }
  22. #define DBGCHARS(_params_) {if (gDebugFlag & _DBGCHARS) DbgPrint _params_ ; }
  23. #define DBGOUTPUT(_params_) {if (gDebugFlag & _DBGOUTPUT) DbgPrint _params_ ; }
  24. #define DBGFULLSCR(_params_) {if (gDebugFlag & _DBGFULLSCR)DbgPrint _params_ ; }
  25. #define DBGPRINT(_params_) DbgPrint _params_
  26. #else
  27. #define DBGFONTS(_params_)
  28. #define DBGFONTS2(_params_)
  29. #define DBGCHARS(_params_)
  30. #define DBGOUTPUT(_params_)
  31. #define DBGFULLSCR(_params_)
  32. #define DBGPRINT(_params_)
  33. #endif
  34. #define CONSOLE_MAX_FONT_NAME_LENGTH 256
  35. #define DATA_CHUNK_SIZE 8192
  36. #define TMP_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 0))
  37. #define BMP_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 1))
  38. #define ALIAS_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 2))
  39. #define HISTORY_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 3))
  40. #define TITLE_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 4))
  41. #define HANDLE_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 5))
  42. #define CONSOLE_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 6))
  43. #define ICON_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 7))
  44. #define BUFFER_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 8))
  45. #define WAIT_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 9))
  46. #define FONT_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 10))
  47. #define SCREEN_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 11))
  48. #if defined(FE_SB)
  49. #define TMP_DBCS_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 12))
  50. #define SCREEN_DBCS_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 13))
  51. #define EUDC_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 14))
  52. #define CONVAREA_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 15))
  53. #define IME_TAG (RTL_HEAP_MAKE_TAG(dwConBaseTag, 16))
  54. #endif
  55. #define GetWindowConsole(hWnd) (PCONSOLE_INFORMATION)GetWindowLongPtr((hWnd), GWLP_USERDATA)
  56. /*
  57. * Used to store some console attributes for the console. This is a means
  58. * to cache the color in the extra-window-bytes, so USER/KERNEL can get
  59. * at it for hungapp drawing. The window-offsets are defined in NTUSER\INC.
  60. *
  61. * The other macros are just convenient means for setting the other window
  62. * bytes.
  63. */
  64. #define SetConsoleBkColor(hw,clr) SetWindowLong(hw, GWL_CONSOLE_BKCOLOR, clr)
  65. #define SetConsolePid(hw,pid) SetWindowLong(hw, GWL_CONSOLE_PID, pid)
  66. #define SetConsoleTid(hw,tid) SetWindowLong(hw, GWL_CONSOLE_TID, tid)
  67. /*
  68. * helpful macros
  69. */
  70. #define NELEM(array) (sizeof(array)/sizeof(array[0]))
  71. #define PACKCOORD(pt) (MAKELONG(((pt).X), ((pt).Y)))
  72. // Text Information from PSCREEN_INFORMATION
  73. __inline BYTE SCR_FAMILY(PSCREEN_INFORMATION pScreen) {
  74. return pScreen->BufferInfo.TextInfo.CurrentTextBufferFont.Family;
  75. }
  76. __inline DWORD SCR_FONTNUMBER(PSCREEN_INFORMATION pScreen) {
  77. return pScreen->BufferInfo.TextInfo.CurrentTextBufferFont.FontNumber;
  78. }
  79. __inline LPWSTR SCR_FACENAME(PSCREEN_INFORMATION pScreen) {
  80. return pScreen->BufferInfo.TextInfo.CurrentTextBufferFont.FaceName;
  81. }
  82. __inline COORD SCR_FONTSIZE(PSCREEN_INFORMATION pScreen) {
  83. return pScreen->BufferInfo.TextInfo.CurrentTextBufferFont.FontSize;
  84. }
  85. __inline LONG SCR_FONTWEIGHT(PSCREEN_INFORMATION pScreen) {
  86. return pScreen->BufferInfo.TextInfo.CurrentTextBufferFont.Weight;
  87. }
  88. __inline UINT SCR_FONTCODEPAGE(PSCREEN_INFORMATION pScreen) {
  89. return pScreen->BufferInfo.TextInfo.CurrentTextBufferFont.FontCodePage;
  90. }
  91. // Text Information from PCONSOLE_INFORMATION
  92. #define CON_FAMILY(pCon) SCR_FAMILY((pCon)->CurrentScreenBuffer)
  93. #define CON_FONTNUMBER(pCon) SCR_FONTNUMBER((pCon)->CurrentScreenBuffer)
  94. #define CON_FACENAME(pCon) SCR_FACENAME((pCon)->CurrentScreenBuffer)
  95. #define CON_FONTSIZE(pCon) SCR_FONTSIZE((pCon)->CurrentScreenBuffer)
  96. #define CON_FONTWEIGHT(pCon) SCR_FONTWEIGHT((pCon)->CurrentScreenBuffer)
  97. #define CON_FONTCODEPAGE(pCon) SCR_FONTCODEPAGE((pCon)->CurrentScreenBuffer)
  98. #if defined(FE_SB)
  99. extern BOOLEAN gfIsDBCSACP; // TRUE if System ACP is associated with DBCS font
  100. #define CONSOLE_IS_DBCS_ENABLED() (gfIsDBCSACP)
  101. #define CONSOLE_IS_IME_ENABLED() (gfIsDBCSACP)
  102. #define CONSOLE_IS_DBCS_OUTPUTCP(Console) ((Console)->fIsDBCSOutputCP)
  103. #define CONSOLE_IS_DBCS_CP(Console) ((Console)->fIsDBCSCP)
  104. #else // FE_SB
  105. #define CONSOLE_IS_DBCS_ENABLED() (FALSE)
  106. #define CONSOLE_IS_IME_ENABLED() (FALSE)
  107. #endif // FE_SB
  108. #ifdef UNICODE
  109. #define LoadStringEx LoadStringExW
  110. #else
  111. #define LoadStringEx LoadStringExA
  112. #endif
  113. //
  114. // Cache the heap pointer for use by memory routines.
  115. //
  116. extern PWIN32HEAP pConHeap;
  117. extern DWORD dwConBaseTag;
  118. //
  119. // Wrappers for console heap code.
  120. //
  121. #define ConsoleHeapAlloc(Flags, Size) \
  122. Win32HeapAlloc(pConHeap, Size, Flags, Flags)
  123. #define ConsoleHeapReAlloc(Flags, Address, Size) \
  124. Win32HeapReAlloc(pConHeap, Address, Size, Flags)
  125. #if DBG
  126. #define ConsoleHeapFree(Address) \
  127. { \
  128. Win32HeapFree(pConHeap, Address); \
  129. Address = IntToPtr(0xBAADF00D); \
  130. }
  131. #else
  132. #define ConsoleHeapFree(Address) \
  133. { \
  134. Win32HeapFree(pConHeap, Address); \
  135. }
  136. #endif
  137. #define ConsoleHeapSize(Address) \
  138. Win32HeapSize(pConHeap, Address)
  139. //
  140. // handle.c
  141. //
  142. #if DBG
  143. VOID RefConsole(
  144. PCONSOLE_INFORMATION Console);
  145. VOID DerefConsole(
  146. PCONSOLE_INFORMATION Console);
  147. #else
  148. __inline VOID RefConsole(
  149. PCONSOLE_INFORMATION Console)
  150. {
  151. Console->RefCount += 1;
  152. }
  153. __inline VOID DerefConsole(
  154. PCONSOLE_INFORMATION Console)
  155. {
  156. Console->RefCount -= 1;
  157. }
  158. #endif
  159. NTSTATUS
  160. ConsoleAddProcessRoutine(
  161. IN PCSR_PROCESS ParentProcess,
  162. IN PCSR_PROCESS Process
  163. );
  164. NTSTATUS
  165. DereferenceConsoleHandle(
  166. IN HANDLE ConsoleHandle,
  167. OUT PCONSOLE_INFORMATION *Console
  168. );
  169. NTSTATUS
  170. AllocateConsoleHandle(
  171. OUT PHANDLE Handle
  172. );
  173. NTSTATUS
  174. FreeConsoleHandle(
  175. IN HANDLE Handle
  176. );
  177. NTSTATUS
  178. ValidateConsole(
  179. IN PCONSOLE_INFORMATION Console
  180. );
  181. NTSTATUS
  182. ApiPreamble(
  183. IN HANDLE ConsoleHandle,
  184. OUT PCONSOLE_INFORMATION *Console
  185. );
  186. NTSTATUS
  187. RevalidateConsole(
  188. IN HANDLE ConsoleHandle,
  189. OUT PCONSOLE_INFORMATION *Console
  190. );
  191. NTSTATUS
  192. InitializeConsoleHandleTable( VOID );
  193. #if DBG
  194. VOID LockConsoleHandleTable(VOID);
  195. VOID UnlockConsoleHandleTable(VOID);
  196. VOID LockConsole(
  197. IN PCONSOLE_INFORMATION Console
  198. );
  199. #else
  200. #define LockConsoleHandleTable() RtlEnterCriticalSection(&ConsoleHandleLock)
  201. #define UnlockConsoleHandleTable() RtlLeaveCriticalSection(&ConsoleHandleLock)
  202. #define LockConsole(Con) RtlEnterCriticalSection(&(Con)->ConsoleLock)
  203. #endif // DBG
  204. #define ConvertAttrToRGB(Con, Attr) ((Con)->ColorTable[(Attr) & 0x0F])
  205. BOOLEAN
  206. UnProtectHandle(
  207. HANDLE hObject
  208. );
  209. NTSTATUS
  210. MapEventHandles(
  211. IN HANDLE ClientProcessHandle,
  212. IN PCONSOLE_INFORMATION Console,
  213. IN OUT PCONSOLE_INFO ConsoleInfo
  214. );
  215. NTSTATUS
  216. AllocateConsole(
  217. IN HANDLE ConsoleHandle,
  218. IN LPWSTR Title,
  219. IN USHORT TitleLength,
  220. IN HANDLE ClientProcessHandle,
  221. OUT PHANDLE StdIn,
  222. OUT PHANDLE StdOut,
  223. OUT PHANDLE StdErr,
  224. OUT PCONSOLE_PER_PROCESS_DATA ProcessData,
  225. IN OUT PCONSOLE_INFO ConsoleInfo,
  226. IN BOOLEAN WindowVisible,
  227. IN DWORD ConsoleThreadId
  228. );
  229. VOID
  230. DestroyConsole(
  231. IN PCONSOLE_INFORMATION Console
  232. );
  233. VOID
  234. FreeCon(
  235. IN PCONSOLE_INFORMATION Console
  236. );
  237. VOID
  238. InsertScreenBuffer(
  239. IN PCONSOLE_INFORMATION Console,
  240. IN PSCREEN_INFORMATION ScreenInfo
  241. );
  242. VOID
  243. RemoveScreenBuffer(
  244. IN PCONSOLE_INFORMATION Console,
  245. IN PSCREEN_INFORMATION ScreenInfo
  246. );
  247. VOID
  248. FreeProcessData(
  249. IN PCONSOLE_PER_PROCESS_DATA ProcessData
  250. );
  251. NTSTATUS
  252. AllocateIoHandle(
  253. IN PCONSOLE_PER_PROCESS_DATA ProcessData,
  254. IN ULONG HandleType,
  255. OUT PHANDLE Handle
  256. );
  257. NTSTATUS
  258. GrowIoHandleTable(
  259. IN PCONSOLE_PER_PROCESS_DATA ProcessData
  260. );
  261. NTSTATUS
  262. FreeIoHandle(
  263. IN PCONSOLE_PER_PROCESS_DATA ProcessData,
  264. IN HANDLE Handle
  265. );
  266. NTSTATUS
  267. DereferenceIoHandleNoCheck(
  268. IN PCONSOLE_PER_PROCESS_DATA ProcessData,
  269. IN HANDLE Handle,
  270. OUT PHANDLE_DATA *HandleData
  271. );
  272. NTSTATUS
  273. DereferenceIoHandle(
  274. IN PCONSOLE_PER_PROCESS_DATA ProcessData,
  275. IN HANDLE Handle,
  276. IN ULONG HandleType,
  277. IN ACCESS_MASK Access,
  278. OUT PHANDLE_DATA *HandleData
  279. );
  280. BOOLEAN
  281. InitializeInputHandle(
  282. PHANDLE_DATA HandleData,
  283. PINPUT_INFORMATION InputBuffer
  284. );
  285. VOID
  286. InitializeOutputHandle(
  287. PHANDLE_DATA HandleData,
  288. PSCREEN_INFORMATION ScreenBuffer
  289. );
  290. ULONG
  291. SrvVerifyConsoleIoHandle(
  292. IN OUT PCSR_API_MSG m,
  293. IN OUT PCSR_REPLY_STATUS ReplyStatus
  294. );
  295. //
  296. // share.c
  297. //
  298. NTSTATUS
  299. ConsoleAddShare(
  300. IN ACCESS_MASK DesiredAccess,
  301. IN ULONG DesiredShareAccess,
  302. IN OUT PCONSOLE_SHARE_ACCESS ShareAccess,
  303. IN OUT PHANDLE_DATA HandleData
  304. );
  305. NTSTATUS
  306. ConsoleDupShare(
  307. IN ACCESS_MASK DesiredAccess,
  308. IN ULONG DesiredShareAccess,
  309. IN OUT PCONSOLE_SHARE_ACCESS ShareAccess,
  310. IN OUT PHANDLE_DATA TargetHandleData
  311. );
  312. NTSTATUS
  313. ConsoleRemoveShare(
  314. IN ULONG DesiredAccess,
  315. IN ULONG DesiredShareAccess,
  316. IN OUT PCONSOLE_SHARE_ACCESS ShareAccess
  317. );
  318. //
  319. // find.c
  320. //
  321. #define SEARCH_STRING_LENGTH (80)
  322. VOID
  323. DoFind(
  324. IN PCONSOLE_INFORMATION Console
  325. );
  326. USHORT
  327. SearchForString(
  328. IN PSCREEN_INFORMATION ScreenInfo,
  329. IN PWSTR SearchString,
  330. IN USHORT StringLength,
  331. IN BOOLEAN IgnoreCase,
  332. IN BOOLEAN Reverse,
  333. IN BOOLEAN SearchAndSetAttr,
  334. IN ULONG Attr,
  335. OUT PCOORD StringPosition
  336. );
  337. //
  338. // output.c
  339. //
  340. VOID
  341. ScrollScreen(
  342. IN PSCREEN_INFORMATION ScreenInfo,
  343. IN PSMALL_RECT ScrollRect,
  344. IN PSMALL_RECT MergeRect,
  345. IN COORD TargetPoint
  346. );
  347. VOID
  348. SetProcessForegroundRights(
  349. IN PCSR_PROCESS Process,
  350. IN BOOL Foreground
  351. );
  352. VOID
  353. SetProcessFocus(
  354. IN PCSR_PROCESS Process,
  355. IN BOOL Foreground
  356. );
  357. VOID
  358. ModifyConsoleProcessFocus(
  359. IN PCONSOLE_INFORMATION Console,
  360. IN BOOL Foreground
  361. );
  362. VOID
  363. InitializeSystemMetrics( VOID );
  364. VOID
  365. InitializeScreenInfo( VOID );
  366. NTSTATUS
  367. ReadScreenBuffer(
  368. IN PSCREEN_INFORMATION ScreenInformation,
  369. OUT PCHAR_INFO Buffer,
  370. IN OUT PSMALL_RECT ReadRegion
  371. );
  372. NTSTATUS
  373. WriteScreenBuffer(
  374. IN PSCREEN_INFORMATION ScreenInformation,
  375. OUT PCHAR_INFO Buffer,
  376. IN OUT PSMALL_RECT WriteRegion
  377. );
  378. NTSTATUS
  379. DoCreateScreenBuffer(
  380. IN PCONSOLE_INFORMATION Console,
  381. IN PCONSOLE_INFO ConsoleInfo
  382. );
  383. NTSTATUS
  384. CreateScreenBuffer(
  385. OUT PSCREEN_INFORMATION *ScreenInformation,
  386. IN COORD dwWindowSize OPTIONAL,
  387. IN DWORD nFont OPTIONAL,
  388. IN COORD dwScreenBufferSize OPTIONAL,
  389. IN CHAR_INFO Fill,
  390. IN CHAR_INFO PopupFill,
  391. IN PCONSOLE_INFORMATION Console,
  392. IN DWORD Flags,
  393. IN PCONSOLE_GRAPHICS_BUFFER_INFO GraphicsBufferInfo OPTIONAL,
  394. OUT PVOID *lpBitmap,
  395. OUT HANDLE *hMutex,
  396. IN UINT CursorSize,
  397. IN LPWSTR FaceName
  398. );
  399. VOID
  400. AbortCreateConsole(
  401. IN PCONSOLE_INFORMATION Console
  402. );
  403. NTSTATUS
  404. CreateWindowsWindow(
  405. IN PCONSOLE_INFORMATION Console
  406. );
  407. VOID
  408. DestroyWindowsWindow(
  409. IN PCONSOLE_INFORMATION Console
  410. );
  411. NTSTATUS
  412. FreeScreenBuffer(
  413. IN PSCREEN_INFORMATION ScreenInformation
  414. );
  415. NTSTATUS
  416. ReadOutputString(
  417. IN PSCREEN_INFORMATION ScreenInfo,
  418. OUT PVOID Buffer,
  419. IN COORD ReadCoord,
  420. IN ULONG StringType,
  421. IN OUT PULONG NumRecords // this value is valid even for error cases
  422. );
  423. NTSTATUS
  424. InitializeScrollBuffer( VOID );
  425. NTSTATUS
  426. GetScreenBufferInformation(
  427. IN PSCREEN_INFORMATION ScreenInfo,
  428. OUT PCOORD Size,
  429. OUT PCOORD CursorPosition,
  430. OUT PCOORD ScrollPosition,
  431. OUT PWORD Attributes,
  432. OUT PCOORD CurrentWindowSize,
  433. OUT PCOORD MaximumWindowSize
  434. );
  435. VOID
  436. GetWindowLimits(
  437. IN PSCREEN_INFORMATION ScreenInfo,
  438. OUT PWINDOW_LIMITS WindowLimits
  439. );
  440. NTSTATUS
  441. ResizeWindow(
  442. IN PSCREEN_INFORMATION ScreenInfo,
  443. IN PSMALL_RECT WindowDimensions,
  444. IN BOOL DoScrollBarUpdate
  445. );
  446. NTSTATUS
  447. ResizeScreenBuffer(
  448. IN PSCREEN_INFORMATION ScreenInfo,
  449. IN COORD NewScreenSize,
  450. IN BOOL DoScrollBarUpdate
  451. );
  452. NTSTATUS
  453. ScrollRegion(
  454. IN PSCREEN_INFORMATION ScreenInfo,
  455. IN PSMALL_RECT ScrollRectangle,
  456. IN PSMALL_RECT ClipRectangle OPTIONAL,
  457. IN COORD DestinationOrigin,
  458. IN CHAR_INFO Fill
  459. );
  460. NTSTATUS
  461. SetWindowOrigin(
  462. IN PSCREEN_INFORMATION ScreenInfo,
  463. IN BOOLEAN Absolute,
  464. IN OUT COORD WindowOrigin
  465. );
  466. VOID
  467. SetWindowSize(
  468. IN PSCREEN_INFORMATION ScreenInfo
  469. );
  470. NTSTATUS
  471. SetActiveScreenBuffer(
  472. IN PSCREEN_INFORMATION ScreenInfo
  473. );
  474. NTSTATUS
  475. QueueConsoleMessage(
  476. PCONSOLE_INFORMATION Console,
  477. UINT Message,
  478. WPARAM wParam,
  479. LPARAM lParam
  480. );
  481. VOID
  482. ConsoleNotifyWinEvent(
  483. IN PCONSOLE_INFORMATION Console,
  484. IN DWORD Event,
  485. IN LONG idObjectType,
  486. IN LONG idObject);
  487. LRESULT APIENTRY
  488. ConsoleWindowProc(
  489. HWND hWnd,
  490. UINT Message,
  491. WPARAM wParam,
  492. LPARAM lParam
  493. );
  494. VOID
  495. VerticalScroll(
  496. IN PCONSOLE_INFORMATION Console,
  497. IN PSCREEN_INFORMATION ScreenInfo,
  498. IN WORD ScrollCommand,
  499. IN WORD AbsoluteChange
  500. );
  501. VOID
  502. HorizontalScroll(
  503. IN PSCREEN_INFORMATION ScreenInfo,
  504. IN WORD ScrollCommand,
  505. IN WORD AbsoluteChange
  506. );
  507. VOID
  508. StreamScrollRegion(
  509. IN PSCREEN_INFORMATION ScreenInfo
  510. );
  511. #if defined(FE_SB)
  512. VOID
  513. FindAttrIndex(
  514. IN PATTR_PAIR String,
  515. IN SHORT Index,
  516. OUT PATTR_PAIR *IndexedAttr,
  517. OUT PSHORT CountOfAttr
  518. );
  519. VOID
  520. UpdateComplexRegion(
  521. IN PSCREEN_INFORMATION ScreenInfo,
  522. IN COORD FontSize
  523. );
  524. SHORT
  525. ScrollEntireScreen(
  526. IN PSCREEN_INFORMATION ScreenInfo,
  527. IN SHORT ScrollValue,
  528. IN BOOL UpdateRowIndex
  529. );
  530. VOID
  531. UpdateScrollBars(
  532. IN PSCREEN_INFORMATION ScreenInfo
  533. );
  534. #endif
  535. VOID
  536. ReadRectFromScreenBuffer(
  537. IN PSCREEN_INFORMATION ScreenInfo,
  538. IN COORD SourcePoint,
  539. IN PCHAR_INFO Target,
  540. IN COORD TargetSize,
  541. IN PSMALL_RECT TargetRect
  542. );
  543. VOID
  544. InitializeThreadMessages(VOID);
  545. NTSTATUS
  546. QueueThreadMessage(
  547. DWORD dwThreadId,
  548. UINT Message,
  549. WPARAM wParam,
  550. LPARAM lParam
  551. );
  552. BOOL
  553. UnqueueThreadMessage(
  554. DWORD dwThreadId,
  555. UINT* pMessage,
  556. WPARAM* pwParam,
  557. LPARAM* plParam
  558. );
  559. //
  560. // Drag/Drop on console windows (output.c)
  561. //
  562. UINT ConsoleDragQueryFile(
  563. IN HANDLE hDrop,
  564. IN PVOID lpFile,
  565. IN UINT cb
  566. );
  567. VOID
  568. DoDrop (
  569. IN WPARAM wParam,
  570. IN PCONSOLE_INFORMATION Console
  571. );
  572. //
  573. // input.c
  574. //
  575. NTSTATUS
  576. ReadBuffer(
  577. IN PINPUT_INFORMATION InputInformation,
  578. OUT PVOID Buffer,
  579. IN ULONG Length,
  580. OUT PULONG EventsRead,
  581. IN BOOL Peek,
  582. IN BOOL StreamRead,
  583. OUT PBOOL ResetWaitEvent,
  584. IN BOOLEAN Unicode
  585. );
  586. NTSTATUS
  587. ConsoleInputThread(
  588. IN PINPUT_THREAD_INIT_INFO pInputThreadInitInfo
  589. );
  590. VOID
  591. StoreKeyInfo(
  592. IN PMSG msg
  593. );
  594. VOID
  595. RetrieveKeyInfo(
  596. IN HWND hWnd,
  597. OUT PWORD pwVirtualKeyCode,
  598. OUT PWORD pwVirtualScanCode,
  599. IN BOOL FreeKeyInfo
  600. );
  601. VOID
  602. ClearKeyInfo(
  603. IN HWND hWnd
  604. );
  605. NTSTATUS
  606. ReadInputBuffer(
  607. IN PINPUT_INFORMATION InputInformation,
  608. OUT PINPUT_RECORD lpBuffer,
  609. IN OUT PDWORD nLength,
  610. IN BOOL Peek,
  611. IN BOOL WaitForData,
  612. IN BOOL StreamRead,
  613. IN PCONSOLE_INFORMATION Console,
  614. IN PHANDLE_DATA HandleData OPTIONAL,
  615. IN PCSR_API_MSG Message OPTIONAL,
  616. IN CSR_WAIT_ROUTINE WaitRoutine OPTIONAL,
  617. IN PVOID WaitParameter OPTIONAL,
  618. IN ULONG WaitParameterLength OPTIONAL,
  619. IN BOOLEAN WaitBlockExists OPTIONAL
  620. #if defined(FE_SB)
  621. ,
  622. IN BOOLEAN Unicode
  623. #endif
  624. );
  625. DWORD
  626. WriteInputBuffer(
  627. PCONSOLE_INFORMATION Console,
  628. PINPUT_INFORMATION InputBufferInformation,
  629. PINPUT_RECORD lpBuffer,
  630. DWORD nLength
  631. );
  632. DWORD
  633. PrependInputBuffer(
  634. PCONSOLE_INFORMATION Console,
  635. PINPUT_INFORMATION InputBufferInformation,
  636. PINPUT_RECORD lpBuffer,
  637. DWORD nLength
  638. );
  639. NTSTATUS
  640. CreateInputBuffer(
  641. IN ULONG NumberOfEvents OPTIONAL,
  642. IN PINPUT_INFORMATION InputBufferInformation
  643. #if defined(FE_SB)
  644. ,
  645. IN PCONSOLE_INFORMATION Console
  646. #endif
  647. );
  648. NTSTATUS
  649. ReinitializeInputBuffer(
  650. OUT PINPUT_INFORMATION InputBufferInformation
  651. );
  652. VOID
  653. FreeInputBuffer(
  654. IN PINPUT_INFORMATION InputBufferInformation
  655. );
  656. #if defined(FE_SB)
  657. VOID
  658. ProcessCreateConsoleWindow(
  659. IN LPMSG lpMsg
  660. );
  661. NTSTATUS
  662. WaitForMoreToRead(
  663. IN PINPUT_INFORMATION InputInformation,
  664. IN PCSR_API_MSG Message OPTIONAL,
  665. IN CSR_WAIT_ROUTINE WaitRoutine OPTIONAL,
  666. IN PVOID WaitParameter OPTIONAL,
  667. IN ULONG WaitParameterLength OPTIONAL,
  668. IN BOOLEAN WaitBlockExists OPTIONAL
  669. );
  670. ULONG
  671. GetControlKeyState(
  672. LPARAM lParam
  673. );
  674. VOID
  675. TerminateRead(
  676. IN PCONSOLE_INFORMATION Console,
  677. IN PINPUT_INFORMATION InputInfo,
  678. IN DWORD Flag
  679. );
  680. #endif
  681. NTSTATUS
  682. GetNumberOfReadyEvents(
  683. IN PINPUT_INFORMATION InputInformation,
  684. OUT PULONG NumberOfEvents
  685. );
  686. NTSTATUS
  687. FlushInputBuffer(
  688. IN PINPUT_INFORMATION InputInformation
  689. );
  690. NTSTATUS
  691. FlushAllButKeys(
  692. PINPUT_INFORMATION InputInformation
  693. );
  694. NTSTATUS
  695. SetInputBufferSize(
  696. IN PINPUT_INFORMATION InputInformation,
  697. IN ULONG Size
  698. );
  699. BOOL
  700. HandleSysKeyEvent(
  701. IN PCONSOLE_INFORMATION Console,
  702. IN HWND hWnd,
  703. IN UINT Message,
  704. IN WPARAM wParam,
  705. IN LPARAM lParam,
  706. IN PBOOL pbUnlockConsole
  707. );
  708. VOID
  709. HandleKeyEvent(
  710. IN PCONSOLE_INFORMATION Console,
  711. IN HWND hWnd,
  712. IN UINT Message,
  713. IN WPARAM wParam,
  714. IN LPARAM lParam
  715. );
  716. BOOL
  717. HandleMouseEvent(
  718. IN PCONSOLE_INFORMATION Console,
  719. IN PSCREEN_INFORMATION ScreenInfo,
  720. IN UINT Message,
  721. IN WPARAM wParam,
  722. IN LPARAM lParam
  723. );
  724. VOID
  725. HandleMenuEvent(
  726. IN PCONSOLE_INFORMATION Console,
  727. IN DWORD wParam
  728. );
  729. VOID
  730. HandleFocusEvent(
  731. IN PCONSOLE_INFORMATION Console,
  732. IN BOOL bSetFocus
  733. );
  734. VOID
  735. HandleCtrlEvent(
  736. IN PCONSOLE_INFORMATION Console,
  737. IN DWORD EventType
  738. );
  739. #define CONSOLE_SHUTDOWN_FAILED 0
  740. #define CONSOLE_SHUTDOWN_SUCCEEDED 1
  741. #define CONSOLE_SHUTDOWN_SYSTEM 2
  742. int
  743. CreateCtrlThread(
  744. IN PCONSOLE_PROCESS_TERMINATION_RECORD ProcessHandleList,
  745. IN ULONG ProcessHandleListLength,
  746. IN PWCHAR Title,
  747. IN DWORD EventType,
  748. IN BOOL fForce
  749. );
  750. VOID
  751. UnlockConsole(
  752. IN PCONSOLE_INFORMATION Console
  753. );
  754. ULONG
  755. ShutdownConsole(
  756. IN HANDLE ConsoleHandle,
  757. IN DWORD dwFlags
  758. );
  759. //
  760. // link.c
  761. //
  762. #define LINK_NOINFO 0
  763. #define LINK_SIMPLEINFO 1
  764. #define LINK_FULLINFO 2
  765. DWORD
  766. GetLinkProperties(
  767. LPWSTR pszLinkName,
  768. LPVOID lpvBuffer,
  769. UINT cb
  770. );
  771. DWORD
  772. GetTitleFromLinkName(
  773. IN LPWSTR szLinkName,
  774. OUT LPWSTR szTitle
  775. );
  776. //
  777. // misc.c
  778. //
  779. VOID
  780. InitializeFonts( VOID );
  781. BOOL
  782. InitializeCustomCP( VOID );
  783. #define EF_NEW 0x0001 // a newly available face
  784. #define EF_OLD 0x0002 // a previously available face
  785. #define EF_ENUMERATED 0x0004 // all sizes have been enumerated
  786. #define EF_OEMFONT 0x0008 // an OEM face
  787. #define EF_TTFONT 0x0010 // a TT face
  788. #define EF_DEFFACE 0x0020 // the default face
  789. NTSTATUS
  790. EnumerateFonts( DWORD Flags );
  791. VOID
  792. InitializeMouseButtons( VOID );
  793. NTSTATUS
  794. GetMouseButtons(
  795. PULONG NumButtons
  796. );
  797. NTSTATUS
  798. FindTextBufferFontInfo(
  799. IN PSCREEN_INFORMATION ScreenInfo,
  800. IN UINT CodePage,
  801. OUT PTEXT_BUFFER_FONT_INFO TextFontInfo
  802. );
  803. NTSTATUS
  804. StoreTextBufferFontInfo(
  805. IN PSCREEN_INFORMATION ScreenInfo,
  806. IN ULONG FontIndex,
  807. IN COORD FontSize,
  808. IN BYTE FontFamily,
  809. IN LONG FontWeight,
  810. IN LPWSTR FaceName,
  811. IN UINT CodePage
  812. );
  813. NTSTATUS
  814. RemoveTextBufferFontInfo(
  815. IN PSCREEN_INFORMATION ScreenInfo
  816. );
  817. NTSTATUS
  818. GetNumFonts(
  819. OUT PULONG NumberOfFonts
  820. );
  821. NTSTATUS
  822. GetAvailableFonts(
  823. IN PSCREEN_INFORMATION ScreenInfo,
  824. IN BOOLEAN MaximumWindow,
  825. OUT PVOID Buffer,
  826. IN OUT PULONG NumFonts
  827. );
  828. NTSTATUS
  829. GetFontSize(
  830. IN DWORD FontIndex,
  831. OUT PCOORD FontSize
  832. );
  833. NTSTATUS
  834. GetCurrentFont(
  835. IN PSCREEN_INFORMATION ScreenInfo,
  836. IN BOOLEAN MaximumWindow,
  837. OUT PULONG FontIndex,
  838. OUT PCOORD FontSize
  839. );
  840. NTSTATUS
  841. SetFont(
  842. IN PSCREEN_INFORMATION ScreenInfo
  843. );
  844. NTSTATUS
  845. SetScreenBufferFont(
  846. IN PSCREEN_INFORMATION ScreenInfo,
  847. IN ULONG FontIndex
  848. #if defined(FE_SB)
  849. ,
  850. IN UINT CodePage
  851. #endif
  852. );
  853. int
  854. ConvertToOem(
  855. IN UINT Codepage,
  856. IN LPWSTR Source,
  857. IN int SourceLength,
  858. OUT LPSTR Target,
  859. IN int TargetLength
  860. );
  861. int
  862. ConvertInputToUnicode(
  863. IN UINT Codepage,
  864. IN LPSTR Source,
  865. IN int SourceLength,
  866. OUT LPWSTR Target,
  867. IN int TargetLength
  868. );
  869. #if defined(FE_SB)
  870. WCHAR
  871. SB_CharToWcharGlyph(
  872. IN UINT Codepage,
  873. IN char Ch
  874. );
  875. WCHAR
  876. SB_CharToWchar(
  877. IN UINT Codepage,
  878. IN char Ch
  879. );
  880. #else
  881. WCHAR
  882. CharToWcharGlyph(
  883. IN UINT Codepage,
  884. IN char Ch
  885. );
  886. WCHAR
  887. CharToWchar(
  888. IN UINT Codepage,
  889. IN char Ch
  890. );
  891. #endif
  892. char
  893. WcharToChar(
  894. IN UINT Codepage,
  895. IN WCHAR Wchar
  896. );
  897. int
  898. ConvertOutputToUnicode(
  899. IN UINT Codepage,
  900. IN LPSTR Source,
  901. IN int SourceLength,
  902. OUT LPWSTR Target,
  903. IN int TargetLength
  904. );
  905. int
  906. ConvertOutputToOem(
  907. IN UINT Codepage,
  908. IN LPWSTR Source,
  909. IN int SourceLength, // in chars
  910. OUT LPSTR Target,
  911. IN int TargetLength // in chars
  912. );
  913. NTSTATUS
  914. RealUnicodeToFalseUnicode(
  915. IN OUT LPWSTR Source,
  916. IN int SourceLength, // in chars
  917. IN UINT Codepage
  918. );
  919. NTSTATUS
  920. FalseUnicodeToRealUnicode(
  921. IN OUT LPWSTR Source,
  922. IN int SourceLength, // in chars
  923. IN UINT Codepage
  924. );
  925. VOID
  926. InitializeSubst( VOID );
  927. VOID
  928. ShutdownSubst( VOID );
  929. ULONG
  930. SrvConsoleSubst(
  931. IN OUT PCSR_API_MSG m,
  932. IN OUT PCSR_REPLY_STATUS ReplyStatus
  933. );
  934. typedef struct tagFACENODE {
  935. struct tagFACENODE *pNext;
  936. DWORD dwFlag;
  937. WCHAR awch[];
  938. } FACENODE, *PFACENODE;
  939. BOOL DoFontEnum(
  940. IN HDC hDC OPTIONAL,
  941. IN LPWSTR pwszFace OPTIONAL,
  942. IN SHORT TTPointSize);
  943. #if defined(FE_SB)
  944. VOID
  945. SetConsoleCPInfo(
  946. IN PCONSOLE_INFORMATION Console,
  947. IN BOOL Output
  948. );
  949. BOOL
  950. CheckBisectStringW(
  951. IN PSCREEN_INFORMATION ScreenInfo,
  952. IN DWORD CodePage,
  953. IN PWCHAR Buffer,
  954. IN DWORD NumWords,
  955. IN DWORD NumBytes
  956. );
  957. BOOL
  958. CheckBisectProcessW(
  959. IN PSCREEN_INFORMATION ScreenInfo,
  960. IN DWORD CodePage,
  961. IN PWCHAR Buffer,
  962. IN DWORD NumWords,
  963. IN DWORD NumBytes,
  964. IN SHORT OriginalXPosition,
  965. IN BOOL Echo
  966. );
  967. #endif // FE_SB
  968. //
  969. // directio.c
  970. //
  971. ULONG
  972. SrvGetConsoleInput(
  973. IN OUT PCSR_API_MSG m,
  974. IN OUT PCSR_REPLY_STATUS ReplyStatus
  975. );
  976. ULONG
  977. SrvWriteConsoleInput(
  978. IN OUT PCSR_API_MSG m,
  979. IN OUT PCSR_REPLY_STATUS ReplyStatus
  980. );
  981. ULONG
  982. SrvReadConsoleOutput(
  983. IN OUT PCSR_API_MSG m,
  984. IN OUT PCSR_REPLY_STATUS ReplyStatus
  985. );
  986. ULONG
  987. SrvWriteConsoleOutput(
  988. IN OUT PCSR_API_MSG m,
  989. IN OUT PCSR_REPLY_STATUS ReplyStatus
  990. );
  991. ULONG
  992. SrvReadConsoleOutputString(
  993. IN OUT PCSR_API_MSG m,
  994. IN OUT PCSR_REPLY_STATUS ReplyStatus
  995. );
  996. ULONG
  997. SrvWriteConsoleOutputString(
  998. IN OUT PCSR_API_MSG m,
  999. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1000. );
  1001. ULONG
  1002. SrvFillConsoleOutput(
  1003. IN OUT PCSR_API_MSG m,
  1004. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1005. );
  1006. ULONG
  1007. SrvCreateConsoleScreenBuffer(
  1008. IN OUT PCSR_API_MSG m,
  1009. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1010. );
  1011. NTSTATUS
  1012. TranslateOutputToPaddingUnicode(
  1013. IN PCONSOLE_INFORMATION Console,
  1014. IN OUT PCHAR_INFO OutputBuffer,
  1015. IN COORD Size,
  1016. IN OUT PCHAR_INFO OutputBufferR
  1017. );
  1018. //
  1019. // getset.c
  1020. //
  1021. ULONG
  1022. SrvGetConsoleMode(
  1023. IN OUT PCSR_API_MSG m,
  1024. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1025. );
  1026. ULONG
  1027. SrvGetConsoleNumberOfFonts(
  1028. IN OUT PCSR_API_MSG m,
  1029. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1030. );
  1031. ULONG
  1032. SrvGetConsoleNumberOfInputEvents(
  1033. IN OUT PCSR_API_MSG m,
  1034. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1035. );
  1036. ULONG
  1037. SrvGetLargestConsoleWindowSize(
  1038. IN OUT PCSR_API_MSG m,
  1039. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1040. );
  1041. ULONG
  1042. SrvGetConsoleScreenBufferInfo(
  1043. IN OUT PCSR_API_MSG m,
  1044. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1045. );
  1046. ULONG
  1047. SrvGetConsoleCursorInfo(
  1048. IN OUT PCSR_API_MSG m,
  1049. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1050. );
  1051. ULONG
  1052. SrvGetConsoleSelectionInfo(
  1053. IN OUT PCSR_API_MSG m,
  1054. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1055. );
  1056. ULONG
  1057. SrvGetConsoleMouseInfo(
  1058. IN OUT PCSR_API_MSG m,
  1059. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1060. );
  1061. ULONG
  1062. SrvGetConsoleFontInfo(
  1063. IN OUT PCSR_API_MSG m,
  1064. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1065. );
  1066. ULONG
  1067. SrvGetConsoleFontSize(
  1068. IN OUT PCSR_API_MSG m,
  1069. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1070. );
  1071. ULONG
  1072. SrvGetConsoleCurrentFont(
  1073. IN OUT PCSR_API_MSG m,
  1074. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1075. );
  1076. ULONG
  1077. SrvSetConsoleMode(
  1078. IN OUT PCSR_API_MSG m,
  1079. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1080. );
  1081. ULONG
  1082. SrvGenerateConsoleCtrlEvent(
  1083. IN OUT PCSR_API_MSG m,
  1084. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1085. );
  1086. ULONG
  1087. SrvSetConsoleActiveScreenBuffer(
  1088. IN OUT PCSR_API_MSG m,
  1089. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1090. );
  1091. ULONG
  1092. SrvFlushConsoleInputBuffer(
  1093. IN OUT PCSR_API_MSG m,
  1094. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1095. );
  1096. ULONG
  1097. SrvSetConsoleScreenBufferSize(
  1098. IN OUT PCSR_API_MSG m,
  1099. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1100. );
  1101. ULONG
  1102. SrvSetConsoleCursorPosition(
  1103. IN OUT PCSR_API_MSG m,
  1104. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1105. );
  1106. ULONG
  1107. SrvSetConsoleCursorInfo(
  1108. IN OUT PCSR_API_MSG m,
  1109. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1110. );
  1111. ULONG
  1112. SrvSetConsoleWindowInfo(
  1113. IN OUT PCSR_API_MSG m,
  1114. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1115. );
  1116. ULONG
  1117. SrvScrollConsoleScreenBuffer(
  1118. IN OUT PCSR_API_MSG m,
  1119. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1120. );
  1121. ULONG
  1122. SrvSetConsoleTextAttribute(
  1123. IN OUT PCSR_API_MSG m,
  1124. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1125. );
  1126. ULONG
  1127. SrvSetConsoleFont(
  1128. IN OUT PCSR_API_MSG m,
  1129. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1130. );
  1131. ULONG
  1132. SrvSetConsoleIcon(
  1133. IN OUT PCSR_API_MSG m,
  1134. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1135. );
  1136. NTSTATUS
  1137. SetScreenColors(
  1138. IN PSCREEN_INFORMATION ScreenInfo,
  1139. IN WORD Attributes,
  1140. IN WORD PopupAttributes,
  1141. IN BOOL UpdateWholeScreen
  1142. );
  1143. ULONG
  1144. SrvSetConsoleCP(
  1145. IN OUT PCSR_API_MSG m,
  1146. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1147. );
  1148. ULONG
  1149. SrvGetConsoleCP(
  1150. IN OUT PCSR_API_MSG m,
  1151. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1152. );
  1153. ULONG
  1154. SrvGetConsoleKeyboardLayoutName(
  1155. IN OUT PCSR_API_MSG m,
  1156. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1157. );
  1158. ULONG
  1159. SrvGetConsoleWindow(
  1160. IN OUT PCSR_API_MSG m,
  1161. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1162. );
  1163. //
  1164. // stream.c
  1165. //
  1166. NTSTATUS
  1167. CookedRead(
  1168. IN PCOOKED_READ_DATA CookedReadData,
  1169. IN PCSR_API_MSG WaitReplyMessage,
  1170. IN PCSR_THREAD WaitingThread,
  1171. IN BOOLEAN WaitRoutine
  1172. );
  1173. NTSTATUS
  1174. ReadChars(
  1175. IN PINPUT_INFORMATION InputInfo,
  1176. IN PCONSOLE_INFORMATION Console,
  1177. IN PCONSOLE_PER_PROCESS_DATA ProcessData,
  1178. IN PSCREEN_INFORMATION ScreenInfo,
  1179. IN OUT PWCHAR lpBuffer,
  1180. IN OUT PDWORD NumBytes,
  1181. IN DWORD InitialNumBytes,
  1182. IN DWORD CtrlWakeupMask,
  1183. IN PHANDLE_DATA HandleData,
  1184. IN PCOMMAND_HISTORY CommandHistory,
  1185. IN PCSR_API_MSG Message OPTIONAL,
  1186. IN HANDLE HandleIndex,
  1187. IN USHORT ExeNameLength,
  1188. IN PWCHAR ExeName,
  1189. IN BOOLEAN Unicode
  1190. );
  1191. ULONG
  1192. SrvOpenConsole(
  1193. IN OUT PCSR_API_MSG m,
  1194. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1195. );
  1196. ULONG
  1197. SrvReadConsole(
  1198. IN OUT PCSR_API_MSG m,
  1199. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1200. );
  1201. ULONG
  1202. SrvWriteConsole(
  1203. IN OUT PCSR_API_MSG m,
  1204. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1205. );
  1206. ULONG
  1207. SrvDuplicateHandle(
  1208. IN OUT PCSR_API_MSG m,
  1209. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1210. );
  1211. ULONG
  1212. SrvGetHandleInformation(
  1213. IN OUT PCSR_API_MSG m,
  1214. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1215. );
  1216. ULONG
  1217. SrvSetHandleInformation(
  1218. IN OUT PCSR_API_MSG m,
  1219. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1220. );
  1221. VOID
  1222. UnblockWriteConsole(
  1223. IN PCONSOLE_INFORMATION Console,
  1224. IN DWORD Reason);
  1225. NTSTATUS
  1226. CloseInputHandle(
  1227. IN PCONSOLE_PER_PROCESS_DATA ProcessData,
  1228. IN PCONSOLE_INFORMATION Console,
  1229. IN PHANDLE_DATA HandleData,
  1230. IN HANDLE Handle
  1231. );
  1232. NTSTATUS
  1233. CloseOutputHandle(
  1234. IN PCONSOLE_PER_PROCESS_DATA ProcessData,
  1235. IN PCONSOLE_INFORMATION Console,
  1236. IN PHANDLE_DATA HandleData,
  1237. IN HANDLE Handle,
  1238. IN BOOLEAN FreeHandle
  1239. );
  1240. ULONG
  1241. SrvCloseHandle(
  1242. IN OUT PCSR_API_MSG m,
  1243. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1244. );
  1245. VOID
  1246. MakeCursorVisible(
  1247. IN PSCREEN_INFORMATION ScreenInfo,
  1248. IN COORD CursorPosition
  1249. );
  1250. #if defined(FE_SB)
  1251. HANDLE
  1252. FindActiveScreenBufferHandle(
  1253. IN PCONSOLE_PER_PROCESS_DATA ProcessData,
  1254. IN PCONSOLE_INFORMATION Console
  1255. );
  1256. NTSTATUS
  1257. WriteString(
  1258. IN PSCREEN_INFORMATION ScreenInfo,
  1259. IN PWCHAR String,
  1260. IN ULONG NumChars,
  1261. IN BOOL KeepCursorVisible,
  1262. OUT PSHORT ScrollY OPTIONAL
  1263. );
  1264. #endif
  1265. //
  1266. // cursor.c
  1267. //
  1268. NTSTATUS
  1269. SetCursorInformation(
  1270. PSCREEN_INFORMATION ScreenInfo,
  1271. ULONG Size,
  1272. BOOLEAN Visible
  1273. );
  1274. NTSTATUS
  1275. SetCursorPosition(
  1276. IN OUT PSCREEN_INFORMATION ScreenInfo,
  1277. IN COORD Position,
  1278. IN BOOL TurnOn
  1279. );
  1280. NTSTATUS
  1281. SetCursorMode(
  1282. PSCREEN_INFORMATION ScreenInfo,
  1283. BOOLEAN DoubleCursor
  1284. );
  1285. VOID
  1286. CursorTimerRoutine(
  1287. IN PSCREEN_INFORMATION ScreenInfo
  1288. );
  1289. #if defined(FE_SB)
  1290. VOID
  1291. SB_InvertPixels(
  1292. IN PSCREEN_INFORMATION ScreenInfo
  1293. );
  1294. #endif
  1295. VOID
  1296. ConsoleHideCursor(
  1297. IN PSCREEN_INFORMATION ScreenInfo
  1298. );
  1299. VOID
  1300. ConsoleShowCursor(
  1301. IN PSCREEN_INFORMATION ScreenInfo
  1302. );
  1303. #ifdef i386
  1304. NTSTATUS
  1305. SetCursorInformationHW(
  1306. PSCREEN_INFORMATION ScreenInfo,
  1307. ULONG Size,
  1308. BOOLEAN Visible
  1309. );
  1310. NTSTATUS
  1311. SetCursorPositionHW(
  1312. IN OUT PSCREEN_INFORMATION ScreenInfo,
  1313. IN COORD Position
  1314. );
  1315. #endif
  1316. //
  1317. // cmdline.c
  1318. //
  1319. VOID
  1320. InitializeConsoleCommandData(
  1321. IN PCONSOLE_INFORMATION Console
  1322. );
  1323. ULONG
  1324. SrvAddConsoleAlias(
  1325. IN OUT PCSR_API_MSG m,
  1326. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1327. );
  1328. ULONG
  1329. SrvGetConsoleAlias(
  1330. IN OUT PCSR_API_MSG m,
  1331. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1332. );
  1333. DWORD
  1334. SrvGetConsoleAliasesLength(
  1335. IN OUT PCSR_API_MSG m,
  1336. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1337. );
  1338. DWORD
  1339. SrvGetConsoleAliasExesLength(
  1340. IN OUT PCSR_API_MSG m,
  1341. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1342. );
  1343. DWORD
  1344. SrvGetConsoleAliases(
  1345. IN OUT PCSR_API_MSG m,
  1346. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1347. );
  1348. DWORD
  1349. SrvGetConsoleAliasExes(
  1350. IN OUT PCSR_API_MSG m,
  1351. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1352. );
  1353. DWORD
  1354. SrvExpungeConsoleCommandHistory(
  1355. IN OUT PCSR_API_MSG m,
  1356. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1357. );
  1358. DWORD
  1359. SrvSetConsoleNumberOfCommands(
  1360. IN OUT PCSR_API_MSG m,
  1361. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1362. );
  1363. DWORD
  1364. SrvGetConsoleCommandHistoryLength(
  1365. IN OUT PCSR_API_MSG m,
  1366. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1367. );
  1368. DWORD
  1369. SrvGetConsoleCommandHistory(
  1370. IN OUT PCSR_API_MSG m,
  1371. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1372. );
  1373. DWORD
  1374. SrvSetConsoleCommandHistoryMode(
  1375. IN OUT PCSR_API_MSG m,
  1376. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1377. );
  1378. NTSTATUS
  1379. MatchandCopyAlias(
  1380. IN PCONSOLE_INFORMATION Console,
  1381. IN PWCHAR Source,
  1382. IN USHORT SourceLength,
  1383. OUT PWCHAR TargetBuffer,
  1384. IN OUT PUSHORT TargetLength,
  1385. IN LPWSTR Exe,
  1386. IN USHORT ExeLength,
  1387. OUT PDWORD LineCount
  1388. );
  1389. NTSTATUS
  1390. AddCommand(
  1391. IN PCOMMAND_HISTORY CommandHistory,
  1392. IN PWCHAR Command,
  1393. IN USHORT Length,
  1394. IN BOOL HistoryNoDup
  1395. );
  1396. NTSTATUS
  1397. RetrieveCommand(
  1398. IN PCOMMAND_HISTORY CommandHistory,
  1399. IN WORD VirtualKeyCode,
  1400. IN PWCHAR Buffer,
  1401. IN ULONG BufferSize,
  1402. OUT PULONG CommandSize
  1403. );
  1404. PCOMMAND_HISTORY
  1405. AllocateCommandHistory(
  1406. IN PCONSOLE_INFORMATION Console,
  1407. IN DWORD AppNameLength,
  1408. IN PWCHAR AppName,
  1409. IN HANDLE ProcessHandle
  1410. );
  1411. VOID
  1412. ResetCommandHistory(
  1413. IN PCOMMAND_HISTORY CommandHistory
  1414. );
  1415. ULONG
  1416. SrvGetConsoleTitle(
  1417. IN OUT PCSR_API_MSG m,
  1418. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1419. );
  1420. ULONG
  1421. SrvSetConsoleTitle(
  1422. IN OUT PCSR_API_MSG m,
  1423. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1424. );
  1425. VOID
  1426. FreeAliasBuffers(
  1427. IN PCONSOLE_INFORMATION Console
  1428. );
  1429. VOID
  1430. FreeCommandHistory(
  1431. IN PCONSOLE_INFORMATION Console,
  1432. IN HANDLE ProcessHandle
  1433. );
  1434. VOID
  1435. FreeCommandHistoryBuffers(
  1436. IN OUT PCONSOLE_INFORMATION Console
  1437. );
  1438. VOID
  1439. ResizeCommandHistoryBuffers(
  1440. IN PCONSOLE_INFORMATION Console,
  1441. IN UINT NumCommands
  1442. );
  1443. int
  1444. MyStringCompareW(
  1445. IN LPWSTR Str1,
  1446. IN LPWSTR Str2,
  1447. IN USHORT Length,
  1448. IN BOOLEAN bCaseInsensitive
  1449. );
  1450. int
  1451. LoadStringExW(
  1452. IN HINSTANCE hModule,
  1453. IN UINT wID,
  1454. OUT LPWSTR lpBuffer,
  1455. IN int cchBufferMax,
  1456. IN WORD wLangId
  1457. );
  1458. //
  1459. // srvinit.c
  1460. //
  1461. ULONG
  1462. SrvAllocConsole(
  1463. IN OUT PCSR_API_MSG m,
  1464. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1465. );
  1466. ULONG
  1467. SrvFreeConsole(
  1468. IN OUT PCSR_API_MSG m,
  1469. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1470. );
  1471. ULONG
  1472. SrvAttachConsole(
  1473. IN OUT PCSR_API_MSG m,
  1474. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1475. );
  1476. ULONG
  1477. SrvGetConsoleProcessList(
  1478. IN OUT PCSR_API_MSG m,
  1479. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1480. );
  1481. NTSTATUS
  1482. RemoveConsole(
  1483. IN PCONSOLE_PER_PROCESS_DATA ProcessData,
  1484. IN HANDLE ProcessHandle,
  1485. IN HANDLE ProcessId
  1486. );
  1487. BOOL
  1488. MapHandle(
  1489. IN HANDLE ClientProcessHandle,
  1490. IN HANDLE ServerHandle,
  1491. OUT PHANDLE ClientHandle
  1492. );
  1493. VOID
  1494. InitializeConsoleAttributes( VOID );
  1495. VOID
  1496. GetRegistryValues(
  1497. IN LPWSTR ConsoleTitle,
  1498. OUT PCONSOLE_REGISTRY_INFO RegInfo
  1499. );
  1500. #if defined(FE_SB)
  1501. NTSTATUS
  1502. MyRegOpenKey(
  1503. IN HANDLE hKey,
  1504. IN LPWSTR lpSubKey,
  1505. OUT PHANDLE phResult
  1506. );
  1507. NTSTATUS
  1508. MyRegQueryValue(
  1509. IN HANDLE hKey,
  1510. IN LPWSTR lpValueName,
  1511. IN DWORD dwValueLength,
  1512. OUT LPBYTE lpData
  1513. );
  1514. NTSTATUS
  1515. MyRegQueryValueEx(
  1516. IN HANDLE hKey,
  1517. IN LPWSTR lpValueName,
  1518. IN DWORD dwValueLength,
  1519. OUT LPBYTE lpData,
  1520. OUT LPDWORD lpDataLength
  1521. );
  1522. NTSTATUS
  1523. MyRegEnumValue(
  1524. IN HANDLE hKey,
  1525. IN DWORD dwIndex,
  1526. OUT DWORD dwValueLength,
  1527. OUT LPWSTR lpValueName,
  1528. OUT DWORD dwDataLength,
  1529. OUT LPBYTE lpData
  1530. );
  1531. #endif
  1532. LPWSTR
  1533. TranslateConsoleTitle(
  1534. LPWSTR ConsoleTitle,
  1535. PUSHORT pcbTranslatedLength,
  1536. BOOL Unexpand,
  1537. BOOL Substitute
  1538. );
  1539. NTSTATUS
  1540. GetConsoleLangId(
  1541. IN UINT OutputCP,
  1542. OUT LANGID* pLangId
  1543. );
  1544. ULONG
  1545. SrvGetConsoleLangId(
  1546. IN OUT PCSR_API_MSG m,
  1547. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1548. );
  1549. //
  1550. // bitmap.c
  1551. //
  1552. NTSTATUS
  1553. CreateConsoleBitmap(
  1554. IN OUT PCONSOLE_GRAPHICS_BUFFER_INFO GraphicsInfo,
  1555. IN OUT PSCREEN_INFORMATION ScreenInfo,
  1556. OUT PVOID *lpBitmap,
  1557. OUT HANDLE *hMutex
  1558. );
  1559. NTSTATUS
  1560. WriteRegionToScreenBitMap(
  1561. IN PSCREEN_INFORMATION ScreenInfo,
  1562. IN PSMALL_RECT Region
  1563. );
  1564. ULONG
  1565. SrvInvalidateBitMapRect(
  1566. IN OUT PCSR_API_MSG m,
  1567. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1568. );
  1569. ULONG
  1570. SrvVDMConsoleOperation(
  1571. IN OUT PCSR_API_MSG m,
  1572. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1573. );
  1574. //
  1575. // private.c
  1576. //
  1577. VOID
  1578. UpdateMousePosition(
  1579. PSCREEN_INFORMATION ScreenInfo,
  1580. COORD Position
  1581. );
  1582. ULONG
  1583. SrvSetConsoleCursor(
  1584. IN OUT PCSR_API_MSG m,
  1585. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1586. );
  1587. ULONG
  1588. SrvShowConsoleCursor(
  1589. IN OUT PCSR_API_MSG m,
  1590. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1591. );
  1592. ULONG
  1593. SrvConsoleMenuControl(
  1594. IN OUT PCSR_API_MSG m,
  1595. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1596. );
  1597. ULONG
  1598. SrvSetConsolePalette(
  1599. IN OUT PCSR_API_MSG m,
  1600. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1601. );
  1602. ULONG
  1603. SrvSetConsoleDisplayMode(
  1604. IN OUT PCSR_API_MSG m,
  1605. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1606. );
  1607. VOID
  1608. SetActivePalette(
  1609. IN PSCREEN_INFORMATION ScreenInfo
  1610. );
  1611. VOID
  1612. UnsetActivePalette(
  1613. IN PSCREEN_INFORMATION ScreenInfo
  1614. );
  1615. ULONG
  1616. SrvRegisterConsoleVDM(
  1617. IN OUT PCSR_API_MSG m,
  1618. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1619. );
  1620. NTSTATUS
  1621. SrvConsoleNotifyLastClose(
  1622. IN OUT PCSR_API_MSG m,
  1623. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1624. );
  1625. ULONG
  1626. SrvGetConsoleHardwareState(
  1627. IN OUT PCSR_API_MSG m,
  1628. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1629. );
  1630. ULONG
  1631. SrvSetConsoleHardwareState(
  1632. IN OUT PCSR_API_MSG m,
  1633. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1634. );
  1635. ULONG
  1636. SrvGetConsoleDisplayMode(
  1637. IN OUT PCSR_API_MSG m,
  1638. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1639. );
  1640. ULONG
  1641. SrvSetConsoleMenuClose(
  1642. IN OUT PCSR_API_MSG m,
  1643. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1644. );
  1645. ULONG
  1646. SrvSetConsoleKeyShortcuts(
  1647. IN OUT PCSR_API_MSG m,
  1648. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1649. );
  1650. #ifdef i386
  1651. VOID
  1652. ReadRegionFromScreenHW(
  1653. IN PSCREEN_INFORMATION ScreenInfo,
  1654. IN PSMALL_RECT Region,
  1655. IN PCHAR_INFO ReadBufPtr
  1656. );
  1657. VOID
  1658. ScrollHW(
  1659. IN PSCREEN_INFORMATION ScreenInfo,
  1660. IN PSMALL_RECT ScrollRect,
  1661. IN PSMALL_RECT MergeRect,
  1662. IN COORD TargetPoint
  1663. );
  1664. ULONG
  1665. MatchWindowSize(
  1666. #if defined(FE_SB)
  1667. IN UINT CodePage,
  1668. #endif
  1669. IN COORD WindowSize,
  1670. OUT PCOORD pWindowSize
  1671. );
  1672. BOOL
  1673. SetVideoMode(
  1674. IN PSCREEN_INFORMATION ScreenInfo
  1675. );
  1676. NTSTATUS
  1677. DisplayModeTransition(
  1678. IN BOOL Foreground,
  1679. IN PCONSOLE_INFORMATION Console,
  1680. IN PSCREEN_INFORMATION ScreenInfo
  1681. );
  1682. NTSTATUS
  1683. ConvertToWindowed(
  1684. IN PCONSOLE_INFORMATION Console
  1685. );
  1686. NTSTATUS
  1687. ConvertToFullScreen(
  1688. IN PCONSOLE_INFORMATION Console
  1689. );
  1690. NTSTATUS
  1691. SetROMFontCodePage(
  1692. IN UINT wCodePage,
  1693. IN ULONG ModeIndex
  1694. );
  1695. #endif
  1696. BOOL
  1697. InitializeFullScreen( VOID );
  1698. NTSTATUS
  1699. ChangeDispSettings(
  1700. PCONSOLE_INFORMATION Console,
  1701. HWND hwnd,
  1702. DWORD dwFlags
  1703. );
  1704. #define SCREEN_BUFFER_POINTER(X,Y,XSIZE,CELLSIZE) (((XSIZE * (Y)) + (X)) * (ULONG)CELLSIZE)
  1705. //
  1706. // menu.c
  1707. //
  1708. VOID
  1709. InitSystemMenu(
  1710. IN PCONSOLE_INFORMATION Console
  1711. );
  1712. VOID
  1713. InitializeMenu(
  1714. IN PCONSOLE_INFORMATION Console
  1715. );
  1716. VOID
  1717. SetWinText(
  1718. IN PCONSOLE_INFORMATION Console,
  1719. IN UINT wID,
  1720. IN BOOL Add
  1721. );
  1722. VOID
  1723. PropertiesDlgShow(
  1724. IN PCONSOLE_INFORMATION Console,
  1725. IN BOOL fCurrent
  1726. );
  1727. VOID
  1728. PropertiesUpdate(
  1729. IN PCONSOLE_INFORMATION Console,
  1730. IN HANDLE hClientSection
  1731. );
  1732. //
  1733. // fontdlg.c
  1734. //
  1735. int
  1736. FindCreateFont(
  1737. DWORD Family,
  1738. LPWSTR pwszTTFace,
  1739. COORD Size,
  1740. LONG Weight,
  1741. UINT CodePage);
  1742. //
  1743. // clipbrd.c
  1744. //
  1745. VOID
  1746. DoCopy(
  1747. IN PCONSOLE_INFORMATION Console
  1748. );
  1749. VOID
  1750. DoMark(
  1751. IN PCONSOLE_INFORMATION Console
  1752. );
  1753. VOID
  1754. DoSelectAll(
  1755. IN PCONSOLE_INFORMATION Console
  1756. );
  1757. VOID
  1758. DoStringPaste(
  1759. IN PCONSOLE_INFORMATION Console,
  1760. IN PWCHAR pwStr,
  1761. IN UINT DataSize
  1762. );
  1763. VOID
  1764. DoPaste(
  1765. IN PCONSOLE_INFORMATION Console
  1766. );
  1767. VOID
  1768. InitializeMouseSelection(
  1769. IN PCONSOLE_INFORMATION Console,
  1770. IN COORD CursorPosition
  1771. );
  1772. VOID
  1773. ExtendSelection(
  1774. IN PCONSOLE_INFORMATION Console,
  1775. IN COORD CursorPosition
  1776. );
  1777. VOID
  1778. ClearSelection(
  1779. IN PCONSOLE_INFORMATION Console
  1780. );
  1781. VOID
  1782. StoreSelection(
  1783. IN PCONSOLE_INFORMATION Console
  1784. );
  1785. VOID
  1786. ColorSelection(
  1787. IN PCONSOLE_INFORMATION Console,
  1788. IN PSMALL_RECT Rect,
  1789. IN ULONG Attr
  1790. );
  1791. VOID
  1792. InvertSelection(
  1793. IN PCONSOLE_INFORMATION Console,
  1794. BOOL Inverting
  1795. );
  1796. #if defined(FE_SB)
  1797. BOOL
  1798. SB_MyInvert(
  1799. IN PCONSOLE_INFORMATION Console,
  1800. IN PSMALL_RECT SmallRect
  1801. );
  1802. #else
  1803. BOOL
  1804. MyInvert(
  1805. IN PCONSOLE_INFORMATION Console,
  1806. IN PSMALL_RECT SmallRect
  1807. );
  1808. #endif
  1809. VOID
  1810. ConvertToMouseSelect(
  1811. IN PCONSOLE_INFORMATION Console,
  1812. IN COORD MousePosition
  1813. );
  1814. VOID
  1815. DoScroll(
  1816. IN PCONSOLE_INFORMATION Console
  1817. );
  1818. VOID
  1819. ClearScroll(
  1820. IN PCONSOLE_INFORMATION Console
  1821. );
  1822. //
  1823. // External private functions used by consrv
  1824. //
  1825. BOOL
  1826. SetConsoleReserveKeys(
  1827. HWND hWnd,
  1828. DWORD fsReserveKeys
  1829. );
  1830. int APIENTRY
  1831. GreGetDIBitsInternal(
  1832. HDC hdc,
  1833. HBITMAP hBitmap,
  1834. UINT iStartScan,
  1835. UINT cNumScan,
  1836. LPBYTE pjBits,
  1837. LPBITMAPINFO pBitsInfo,
  1838. UINT iUsage,
  1839. UINT cjMaxBits,
  1840. UINT cjMaxInfo
  1841. );
  1842. #if defined(FE_SB)
  1843. //
  1844. // constubs.c
  1845. //
  1846. ULONG
  1847. SrvGetConsoleCharType(
  1848. IN OUT PCSR_API_MSG m,
  1849. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1850. );
  1851. ULONG
  1852. SrvSetConsoleLocalEUDC(
  1853. IN OUT PCSR_API_MSG m,
  1854. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1855. );
  1856. ULONG
  1857. SrvSetConsoleCursorMode(
  1858. IN OUT PCSR_API_MSG m,
  1859. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1860. );
  1861. ULONG
  1862. SrvGetConsoleCursorMode(
  1863. IN OUT PCSR_API_MSG m,
  1864. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1865. );
  1866. ULONG
  1867. SrvRegisterConsoleOS2(
  1868. IN OUT PCSR_API_MSG m,
  1869. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1870. );
  1871. ULONG
  1872. SrvSetConsoleOS2OemFormat(
  1873. IN OUT PCSR_API_MSG m,
  1874. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1875. );
  1876. #if defined(FE_IME)
  1877. ULONG
  1878. SrvGetConsoleNlsMode(
  1879. IN OUT PCSR_API_MSG m,
  1880. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1881. );
  1882. ULONG
  1883. SrvSetConsoleNlsMode(
  1884. IN OUT PCSR_API_MSG m,
  1885. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1886. );
  1887. ULONG
  1888. SrvRegisterConsoleIME(
  1889. IN OUT PCSR_API_MSG m,
  1890. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1891. );
  1892. ULONG
  1893. SrvUnregisterConsoleIME(
  1894. IN OUT PCSR_API_MSG m,
  1895. IN OUT PCSR_REPLY_STATUS ReplyStatus
  1896. );
  1897. #endif // FE_IME
  1898. //
  1899. // dispatch.c
  1900. //
  1901. VOID
  1902. InvertPixels(
  1903. IN PSCREEN_INFORMATION ScreenInfo
  1904. );
  1905. WCHAR
  1906. CharToWchar(
  1907. IN PCONSOLE_INFORMATION Console,
  1908. IN UINT Codepage,
  1909. IN char *Ch
  1910. );
  1911. BOOL
  1912. MyInvert(
  1913. IN PCONSOLE_INFORMATION Console,
  1914. IN PSMALL_RECT SmallRect
  1915. );
  1916. #endif // FE_SB