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.

953 lines
20 KiB

  1. /*++ BUILD Version: 0002 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. wincon.h
  5. Abstract:
  6. This module contains the public data structures, data types,
  7. and procedures exported by the NT console subsystem.
  8. Created:
  9. 26-Oct-1990
  10. Revision History:
  11. --*/
  12. #ifndef _WINCON_
  13. #define _WINCON_
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. typedef struct _COORD {
  18. SHORT X;
  19. SHORT Y;
  20. } COORD, *PCOORD;
  21. typedef struct _SMALL_RECT {
  22. SHORT Left;
  23. SHORT Top;
  24. SHORT Right;
  25. SHORT Bottom;
  26. } SMALL_RECT, *PSMALL_RECT;
  27. typedef struct _KEY_EVENT_RECORD {
  28. BOOL bKeyDown;
  29. WORD wRepeatCount;
  30. WORD wVirtualKeyCode;
  31. WORD wVirtualScanCode;
  32. union {
  33. WCHAR UnicodeChar;
  34. CHAR AsciiChar;
  35. } uChar;
  36. DWORD dwControlKeyState;
  37. } KEY_EVENT_RECORD, *PKEY_EVENT_RECORD;
  38. //
  39. // ControlKeyState flags
  40. //
  41. #define RIGHT_ALT_PRESSED 0x0001 // the right alt key is pressed.
  42. #define LEFT_ALT_PRESSED 0x0002 // the left alt key is pressed.
  43. #define RIGHT_CTRL_PRESSED 0x0004 // the right ctrl key is pressed.
  44. #define LEFT_CTRL_PRESSED 0x0008 // the left ctrl key is pressed.
  45. #define SHIFT_PRESSED 0x0010 // the shift key is pressed.
  46. #define NUMLOCK_ON 0x0020 // the numlock light is on.
  47. #define SCROLLLOCK_ON 0x0040 // the scrolllock light is on.
  48. #define CAPSLOCK_ON 0x0080 // the capslock light is on.
  49. #define ENHANCED_KEY 0x0100 // the key is enhanced.
  50. #define NLS_DBCSCHAR 0x00010000 // DBCS for JPN: SBCS/DBCS mode.
  51. #define NLS_ALPHANUMERIC 0x00000000 // DBCS for JPN: Alphanumeric mode.
  52. #define NLS_KATAKANA 0x00020000 // DBCS for JPN: Katakana mode.
  53. #define NLS_HIRAGANA 0x00040000 // DBCS for JPN: Hiragana mode.
  54. #define NLS_ROMAN 0x00400000 // DBCS for JPN: Roman/Noroman mode.
  55. #define NLS_IME_CONVERSION 0x00800000 // DBCS for JPN: IME conversion.
  56. #define NLS_IME_DISABLE 0x20000000 // DBCS for JPN: IME enable/disable.
  57. typedef struct _MOUSE_EVENT_RECORD {
  58. COORD dwMousePosition;
  59. DWORD dwButtonState;
  60. DWORD dwControlKeyState;
  61. DWORD dwEventFlags;
  62. } MOUSE_EVENT_RECORD, *PMOUSE_EVENT_RECORD;
  63. //
  64. // ButtonState flags
  65. //
  66. #define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001
  67. #define RIGHTMOST_BUTTON_PRESSED 0x0002
  68. #define FROM_LEFT_2ND_BUTTON_PRESSED 0x0004
  69. #define FROM_LEFT_3RD_BUTTON_PRESSED 0x0008
  70. #define FROM_LEFT_4TH_BUTTON_PRESSED 0x0010
  71. //
  72. // EventFlags
  73. //
  74. #define MOUSE_MOVED 0x0001
  75. #define DOUBLE_CLICK 0x0002
  76. #define MOUSE_WHEELED 0x0004
  77. typedef struct _WINDOW_BUFFER_SIZE_RECORD {
  78. COORD dwSize;
  79. } WINDOW_BUFFER_SIZE_RECORD, *PWINDOW_BUFFER_SIZE_RECORD;
  80. typedef struct _MENU_EVENT_RECORD {
  81. UINT dwCommandId;
  82. } MENU_EVENT_RECORD, *PMENU_EVENT_RECORD;
  83. typedef struct _FOCUS_EVENT_RECORD {
  84. BOOL bSetFocus;
  85. } FOCUS_EVENT_RECORD, *PFOCUS_EVENT_RECORD;
  86. typedef struct _INPUT_RECORD {
  87. WORD EventType;
  88. union {
  89. KEY_EVENT_RECORD KeyEvent;
  90. MOUSE_EVENT_RECORD MouseEvent;
  91. WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
  92. MENU_EVENT_RECORD MenuEvent;
  93. FOCUS_EVENT_RECORD FocusEvent;
  94. } Event;
  95. } INPUT_RECORD, *PINPUT_RECORD;
  96. //
  97. // EventType flags:
  98. //
  99. #define KEY_EVENT 0x0001 // Event contains key event record
  100. #define MOUSE_EVENT 0x0002 // Event contains mouse event record
  101. #define WINDOW_BUFFER_SIZE_EVENT 0x0004 // Event contains window change event record
  102. #define MENU_EVENT 0x0008 // Event contains menu event record
  103. #define FOCUS_EVENT 0x0010 // event contains focus change
  104. typedef struct _CHAR_INFO {
  105. union {
  106. WCHAR UnicodeChar;
  107. CHAR AsciiChar;
  108. } Char;
  109. WORD Attributes;
  110. } CHAR_INFO, *PCHAR_INFO;
  111. //
  112. // Attributes flags:
  113. //
  114. #define FOREGROUND_BLUE 0x0001 // text color contains blue.
  115. #define FOREGROUND_GREEN 0x0002 // text color contains green.
  116. #define FOREGROUND_RED 0x0004 // text color contains red.
  117. #define FOREGROUND_INTENSITY 0x0008 // text color is intensified.
  118. #define BACKGROUND_BLUE 0x0010 // background color contains blue.
  119. #define BACKGROUND_GREEN 0x0020 // background color contains green.
  120. #define BACKGROUND_RED 0x0040 // background color contains red.
  121. #define BACKGROUND_INTENSITY 0x0080 // background color is intensified.
  122. #define COMMON_LVB_LEADING_BYTE 0x0100 // Leading Byte of DBCS
  123. #define COMMON_LVB_TRAILING_BYTE 0x0200 // Trailing Byte of DBCS
  124. #define COMMON_LVB_GRID_HORIZONTAL 0x0400 // DBCS: Grid attribute: top horizontal.
  125. #define COMMON_LVB_GRID_LVERTICAL 0x0800 // DBCS: Grid attribute: left vertical.
  126. #define COMMON_LVB_GRID_RVERTICAL 0x1000 // DBCS: Grid attribute: right vertical.
  127. #define COMMON_LVB_REVERSE_VIDEO 0x4000 // DBCS: Reverse fore/back ground attribute.
  128. #define COMMON_LVB_UNDERSCORE 0x8000 // DBCS: Underscore.
  129. #define COMMON_LVB_SBCSDBCS 0x0300 // SBCS or DBCS flag.
  130. typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
  131. COORD dwSize;
  132. COORD dwCursorPosition;
  133. WORD wAttributes;
  134. SMALL_RECT srWindow;
  135. COORD dwMaximumWindowSize;
  136. } CONSOLE_SCREEN_BUFFER_INFO, *PCONSOLE_SCREEN_BUFFER_INFO;
  137. typedef struct _CONSOLE_CURSOR_INFO {
  138. DWORD dwSize;
  139. BOOL bVisible;
  140. } CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO;
  141. typedef struct _CONSOLE_FONT_INFO {
  142. DWORD nFont;
  143. COORD dwFontSize;
  144. } CONSOLE_FONT_INFO, *PCONSOLE_FONT_INFO;
  145. #if(_WIN32_WINNT >= 0x0500)
  146. typedef struct _CONSOLE_SELECTION_INFO {
  147. DWORD dwFlags;
  148. COORD dwSelectionAnchor;
  149. SMALL_RECT srSelection;
  150. } CONSOLE_SELECTION_INFO, *PCONSOLE_SELECTION_INFO;
  151. //
  152. // Selection flags
  153. //
  154. #define CONSOLE_NO_SELECTION 0x0000
  155. #define CONSOLE_SELECTION_IN_PROGRESS 0x0001 // selection has begun
  156. #define CONSOLE_SELECTION_NOT_EMPTY 0x0002 // non-null select rectangle
  157. #define CONSOLE_MOUSE_SELECTION 0x0004 // selecting with mouse
  158. #define CONSOLE_MOUSE_DOWN 0x0008 // mouse is down
  159. #endif /* _WIN32_WINNT >= 0x0500 */
  160. //
  161. // typedef for ctrl-c handler routines
  162. //
  163. typedef
  164. BOOL
  165. (WINAPI *PHANDLER_ROUTINE)(
  166. DWORD CtrlType
  167. );
  168. #define CTRL_C_EVENT 0
  169. #define CTRL_BREAK_EVENT 1
  170. #define CTRL_CLOSE_EVENT 2
  171. // 3 is reserved!
  172. // 4 is reserved!
  173. #define CTRL_LOGOFF_EVENT 5
  174. #define CTRL_SHUTDOWN_EVENT 6
  175. //
  176. // Input Mode flags:
  177. //
  178. #define ENABLE_PROCESSED_INPUT 0x0001
  179. #define ENABLE_LINE_INPUT 0x0002
  180. #define ENABLE_ECHO_INPUT 0x0004
  181. #define ENABLE_WINDOW_INPUT 0x0008
  182. #define ENABLE_MOUSE_INPUT 0x0010
  183. //
  184. // Output Mode flags:
  185. //
  186. #define ENABLE_PROCESSED_OUTPUT 0x0001
  187. #define ENABLE_WRAP_AT_EOL_OUTPUT 0x0002
  188. //
  189. // direct API definitions.
  190. //
  191. WINBASEAPI
  192. BOOL
  193. WINAPI
  194. PeekConsoleInputA(
  195. IN HANDLE hConsoleInput,
  196. OUT PINPUT_RECORD lpBuffer,
  197. IN DWORD nLength,
  198. OUT LPDWORD lpNumberOfEventsRead
  199. );
  200. WINBASEAPI
  201. BOOL
  202. WINAPI
  203. PeekConsoleInputW(
  204. IN HANDLE hConsoleInput,
  205. OUT PINPUT_RECORD lpBuffer,
  206. IN DWORD nLength,
  207. OUT LPDWORD lpNumberOfEventsRead
  208. );
  209. #ifdef UNICODE
  210. #define PeekConsoleInput PeekConsoleInputW
  211. #else
  212. #define PeekConsoleInput PeekConsoleInputA
  213. #endif // !UNICODE
  214. WINBASEAPI
  215. BOOL
  216. WINAPI
  217. ReadConsoleInputA(
  218. IN HANDLE hConsoleInput,
  219. OUT PINPUT_RECORD lpBuffer,
  220. IN DWORD nLength,
  221. OUT LPDWORD lpNumberOfEventsRead
  222. );
  223. WINBASEAPI
  224. BOOL
  225. WINAPI
  226. ReadConsoleInputW(
  227. IN HANDLE hConsoleInput,
  228. OUT PINPUT_RECORD lpBuffer,
  229. IN DWORD nLength,
  230. OUT LPDWORD lpNumberOfEventsRead
  231. );
  232. #ifdef UNICODE
  233. #define ReadConsoleInput ReadConsoleInputW
  234. #else
  235. #define ReadConsoleInput ReadConsoleInputA
  236. #endif // !UNICODE
  237. WINBASEAPI
  238. BOOL
  239. WINAPI
  240. WriteConsoleInputA(
  241. IN HANDLE hConsoleInput,
  242. IN CONST INPUT_RECORD *lpBuffer,
  243. IN DWORD nLength,
  244. OUT LPDWORD lpNumberOfEventsWritten
  245. );
  246. WINBASEAPI
  247. BOOL
  248. WINAPI
  249. WriteConsoleInputW(
  250. IN HANDLE hConsoleInput,
  251. IN CONST INPUT_RECORD *lpBuffer,
  252. IN DWORD nLength,
  253. OUT LPDWORD lpNumberOfEventsWritten
  254. );
  255. #ifdef UNICODE
  256. #define WriteConsoleInput WriteConsoleInputW
  257. #else
  258. #define WriteConsoleInput WriteConsoleInputA
  259. #endif // !UNICODE
  260. WINBASEAPI
  261. BOOL
  262. WINAPI
  263. ReadConsoleOutputA(
  264. IN HANDLE hConsoleOutput,
  265. OUT PCHAR_INFO lpBuffer,
  266. IN COORD dwBufferSize,
  267. IN COORD dwBufferCoord,
  268. IN OUT PSMALL_RECT lpReadRegion
  269. );
  270. WINBASEAPI
  271. BOOL
  272. WINAPI
  273. ReadConsoleOutputW(
  274. IN HANDLE hConsoleOutput,
  275. OUT PCHAR_INFO lpBuffer,
  276. IN COORD dwBufferSize,
  277. IN COORD dwBufferCoord,
  278. IN OUT PSMALL_RECT lpReadRegion
  279. );
  280. #ifdef UNICODE
  281. #define ReadConsoleOutput ReadConsoleOutputW
  282. #else
  283. #define ReadConsoleOutput ReadConsoleOutputA
  284. #endif // !UNICODE
  285. WINBASEAPI
  286. BOOL
  287. WINAPI
  288. WriteConsoleOutputA(
  289. IN HANDLE hConsoleOutput,
  290. IN CONST CHAR_INFO *lpBuffer,
  291. IN COORD dwBufferSize,
  292. IN COORD dwBufferCoord,
  293. IN OUT PSMALL_RECT lpWriteRegion
  294. );
  295. WINBASEAPI
  296. BOOL
  297. WINAPI
  298. WriteConsoleOutputW(
  299. IN HANDLE hConsoleOutput,
  300. IN CONST CHAR_INFO *lpBuffer,
  301. IN COORD dwBufferSize,
  302. IN COORD dwBufferCoord,
  303. IN OUT PSMALL_RECT lpWriteRegion
  304. );
  305. #ifdef UNICODE
  306. #define WriteConsoleOutput WriteConsoleOutputW
  307. #else
  308. #define WriteConsoleOutput WriteConsoleOutputA
  309. #endif // !UNICODE
  310. WINBASEAPI
  311. BOOL
  312. WINAPI
  313. ReadConsoleOutputCharacterA(
  314. IN HANDLE hConsoleOutput,
  315. OUT LPSTR lpCharacter,
  316. IN DWORD nLength,
  317. IN COORD dwReadCoord,
  318. OUT LPDWORD lpNumberOfCharsRead
  319. );
  320. WINBASEAPI
  321. BOOL
  322. WINAPI
  323. ReadConsoleOutputCharacterW(
  324. IN HANDLE hConsoleOutput,
  325. OUT LPWSTR lpCharacter,
  326. IN DWORD nLength,
  327. IN COORD dwReadCoord,
  328. OUT LPDWORD lpNumberOfCharsRead
  329. );
  330. #ifdef UNICODE
  331. #define ReadConsoleOutputCharacter ReadConsoleOutputCharacterW
  332. #else
  333. #define ReadConsoleOutputCharacter ReadConsoleOutputCharacterA
  334. #endif // !UNICODE
  335. WINBASEAPI
  336. BOOL
  337. WINAPI
  338. ReadConsoleOutputAttribute(
  339. IN HANDLE hConsoleOutput,
  340. OUT LPWORD lpAttribute,
  341. IN DWORD nLength,
  342. IN COORD dwReadCoord,
  343. OUT LPDWORD lpNumberOfAttrsRead
  344. );
  345. WINBASEAPI
  346. BOOL
  347. WINAPI
  348. WriteConsoleOutputCharacterA(
  349. IN HANDLE hConsoleOutput,
  350. IN LPCSTR lpCharacter,
  351. IN DWORD nLength,
  352. IN COORD dwWriteCoord,
  353. OUT LPDWORD lpNumberOfCharsWritten
  354. );
  355. WINBASEAPI
  356. BOOL
  357. WINAPI
  358. WriteConsoleOutputCharacterW(
  359. IN HANDLE hConsoleOutput,
  360. IN LPCWSTR lpCharacter,
  361. IN DWORD nLength,
  362. IN COORD dwWriteCoord,
  363. OUT LPDWORD lpNumberOfCharsWritten
  364. );
  365. #ifdef UNICODE
  366. #define WriteConsoleOutputCharacter WriteConsoleOutputCharacterW
  367. #else
  368. #define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA
  369. #endif // !UNICODE
  370. WINBASEAPI
  371. BOOL
  372. WINAPI
  373. WriteConsoleOutputAttribute(
  374. IN HANDLE hConsoleOutput,
  375. IN CONST WORD *lpAttribute,
  376. IN DWORD nLength,
  377. IN COORD dwWriteCoord,
  378. OUT LPDWORD lpNumberOfAttrsWritten
  379. );
  380. WINBASEAPI
  381. BOOL
  382. WINAPI
  383. FillConsoleOutputCharacterA(
  384. IN HANDLE hConsoleOutput,
  385. IN CHAR cCharacter,
  386. IN DWORD nLength,
  387. IN COORD dwWriteCoord,
  388. OUT LPDWORD lpNumberOfCharsWritten
  389. );
  390. WINBASEAPI
  391. BOOL
  392. WINAPI
  393. FillConsoleOutputCharacterW(
  394. IN HANDLE hConsoleOutput,
  395. IN WCHAR cCharacter,
  396. IN DWORD nLength,
  397. IN COORD dwWriteCoord,
  398. OUT LPDWORD lpNumberOfCharsWritten
  399. );
  400. #ifdef UNICODE
  401. #define FillConsoleOutputCharacter FillConsoleOutputCharacterW
  402. #else
  403. #define FillConsoleOutputCharacter FillConsoleOutputCharacterA
  404. #endif // !UNICODE
  405. WINBASEAPI
  406. BOOL
  407. WINAPI
  408. FillConsoleOutputAttribute(
  409. IN HANDLE hConsoleOutput,
  410. IN WORD wAttribute,
  411. IN DWORD nLength,
  412. IN COORD dwWriteCoord,
  413. OUT LPDWORD lpNumberOfAttrsWritten
  414. );
  415. WINBASEAPI
  416. BOOL
  417. WINAPI
  418. GetConsoleMode(
  419. IN HANDLE hConsoleHandle,
  420. OUT LPDWORD lpMode
  421. );
  422. WINBASEAPI
  423. BOOL
  424. WINAPI
  425. GetNumberOfConsoleInputEvents(
  426. IN HANDLE hConsoleInput,
  427. OUT LPDWORD lpNumberOfEvents
  428. );
  429. WINBASEAPI
  430. BOOL
  431. WINAPI
  432. GetConsoleScreenBufferInfo(
  433. IN HANDLE hConsoleOutput,
  434. OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo
  435. );
  436. WINBASEAPI
  437. COORD
  438. WINAPI
  439. GetLargestConsoleWindowSize(
  440. IN HANDLE hConsoleOutput
  441. );
  442. WINBASEAPI
  443. BOOL
  444. WINAPI
  445. GetConsoleCursorInfo(
  446. IN HANDLE hConsoleOutput,
  447. OUT PCONSOLE_CURSOR_INFO lpConsoleCursorInfo
  448. );
  449. #if(_WIN32_WINNT >= 0x0500)
  450. WINBASEAPI
  451. BOOL
  452. WINAPI
  453. GetCurrentConsoleFont(
  454. IN HANDLE hConsoleOutput,
  455. IN BOOL bMaximumWindow,
  456. OUT PCONSOLE_FONT_INFO lpConsoleCurrentFont
  457. );
  458. WINBASEAPI
  459. COORD
  460. WINAPI
  461. GetConsoleFontSize(
  462. IN HANDLE hConsoleOutput,
  463. IN DWORD nFont
  464. );
  465. WINBASEAPI
  466. BOOL
  467. WINAPI
  468. GetConsoleSelectionInfo(
  469. OUT PCONSOLE_SELECTION_INFO lpConsoleSelectionInfo
  470. );
  471. #endif /* _WIN32_WINNT >= 0x0500 */
  472. WINBASEAPI
  473. BOOL
  474. WINAPI
  475. GetNumberOfConsoleMouseButtons(
  476. OUT LPDWORD lpNumberOfMouseButtons
  477. );
  478. WINBASEAPI
  479. BOOL
  480. WINAPI
  481. SetConsoleMode(
  482. IN HANDLE hConsoleHandle,
  483. IN DWORD dwMode
  484. );
  485. WINBASEAPI
  486. BOOL
  487. WINAPI
  488. SetConsoleActiveScreenBuffer(
  489. IN HANDLE hConsoleOutput
  490. );
  491. WINBASEAPI
  492. BOOL
  493. WINAPI
  494. FlushConsoleInputBuffer(
  495. IN HANDLE hConsoleInput
  496. );
  497. WINBASEAPI
  498. BOOL
  499. WINAPI
  500. SetConsoleScreenBufferSize(
  501. IN HANDLE hConsoleOutput,
  502. IN COORD dwSize
  503. );
  504. WINBASEAPI
  505. BOOL
  506. WINAPI
  507. SetConsoleCursorPosition(
  508. IN HANDLE hConsoleOutput,
  509. IN COORD dwCursorPosition
  510. );
  511. WINBASEAPI
  512. BOOL
  513. WINAPI
  514. SetConsoleCursorInfo(
  515. IN HANDLE hConsoleOutput,
  516. IN CONST CONSOLE_CURSOR_INFO *lpConsoleCursorInfo
  517. );
  518. WINBASEAPI
  519. BOOL
  520. WINAPI
  521. ScrollConsoleScreenBufferA(
  522. IN HANDLE hConsoleOutput,
  523. IN CONST SMALL_RECT *lpScrollRectangle,
  524. IN CONST SMALL_RECT *lpClipRectangle,
  525. IN COORD dwDestinationOrigin,
  526. IN CONST CHAR_INFO *lpFill
  527. );
  528. WINBASEAPI
  529. BOOL
  530. WINAPI
  531. ScrollConsoleScreenBufferW(
  532. IN HANDLE hConsoleOutput,
  533. IN CONST SMALL_RECT *lpScrollRectangle,
  534. IN CONST SMALL_RECT *lpClipRectangle,
  535. IN COORD dwDestinationOrigin,
  536. IN CONST CHAR_INFO *lpFill
  537. );
  538. #ifdef UNICODE
  539. #define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferW
  540. #else
  541. #define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferA
  542. #endif // !UNICODE
  543. WINBASEAPI
  544. BOOL
  545. WINAPI
  546. SetConsoleWindowInfo(
  547. IN HANDLE hConsoleOutput,
  548. IN BOOL bAbsolute,
  549. IN CONST SMALL_RECT *lpConsoleWindow
  550. );
  551. WINBASEAPI
  552. BOOL
  553. WINAPI
  554. SetConsoleTextAttribute(
  555. IN HANDLE hConsoleOutput,
  556. IN WORD wAttributes
  557. );
  558. WINBASEAPI
  559. BOOL
  560. WINAPI
  561. SetConsoleCtrlHandler(
  562. IN PHANDLER_ROUTINE HandlerRoutine,
  563. IN BOOL Add
  564. );
  565. WINBASEAPI
  566. BOOL
  567. WINAPI
  568. GenerateConsoleCtrlEvent(
  569. IN DWORD dwCtrlEvent,
  570. IN DWORD dwProcessGroupId
  571. );
  572. WINBASEAPI
  573. BOOL
  574. WINAPI
  575. AllocConsole( VOID );
  576. WINBASEAPI
  577. BOOL
  578. WINAPI
  579. FreeConsole( VOID );
  580. #if(_WIN32_WINNT >= 0x0500)
  581. WINBASEAPI
  582. BOOL
  583. WINAPI
  584. AttachConsole(
  585. IN DWORD dwProcessId
  586. );
  587. #define ATTACH_PARENT_PROCESS ((DWORD)-1)
  588. #endif /* _WIN32_WINNT >= 0x0500 */
  589. WINBASEAPI
  590. DWORD
  591. WINAPI
  592. GetConsoleTitleA(
  593. OUT LPSTR lpConsoleTitle,
  594. IN DWORD nSize
  595. );
  596. WINBASEAPI
  597. DWORD
  598. WINAPI
  599. GetConsoleTitleW(
  600. OUT LPWSTR lpConsoleTitle,
  601. IN DWORD nSize
  602. );
  603. #ifdef UNICODE
  604. #define GetConsoleTitle GetConsoleTitleW
  605. #else
  606. #define GetConsoleTitle GetConsoleTitleA
  607. #endif // !UNICODE
  608. WINBASEAPI
  609. BOOL
  610. WINAPI
  611. SetConsoleTitleA(
  612. IN LPCSTR lpConsoleTitle
  613. );
  614. WINBASEAPI
  615. BOOL
  616. WINAPI
  617. SetConsoleTitleW(
  618. IN LPCWSTR lpConsoleTitle
  619. );
  620. #ifdef UNICODE
  621. #define SetConsoleTitle SetConsoleTitleW
  622. #else
  623. #define SetConsoleTitle SetConsoleTitleA
  624. #endif // !UNICODE
  625. WINBASEAPI
  626. BOOL
  627. WINAPI
  628. ReadConsoleA(
  629. IN HANDLE hConsoleInput,
  630. OUT LPVOID lpBuffer,
  631. IN DWORD nNumberOfCharsToRead,
  632. OUT LPDWORD lpNumberOfCharsRead,
  633. IN LPVOID lpReserved
  634. );
  635. WINBASEAPI
  636. BOOL
  637. WINAPI
  638. ReadConsoleW(
  639. IN HANDLE hConsoleInput,
  640. OUT LPVOID lpBuffer,
  641. IN DWORD nNumberOfCharsToRead,
  642. OUT LPDWORD lpNumberOfCharsRead,
  643. IN LPVOID lpReserved
  644. );
  645. #ifdef UNICODE
  646. #define ReadConsole ReadConsoleW
  647. #else
  648. #define ReadConsole ReadConsoleA
  649. #endif // !UNICODE
  650. WINBASEAPI
  651. BOOL
  652. WINAPI
  653. WriteConsoleA(
  654. IN HANDLE hConsoleOutput,
  655. IN CONST VOID *lpBuffer,
  656. IN DWORD nNumberOfCharsToWrite,
  657. OUT LPDWORD lpNumberOfCharsWritten,
  658. IN LPVOID lpReserved
  659. );
  660. WINBASEAPI
  661. BOOL
  662. WINAPI
  663. WriteConsoleW(
  664. IN HANDLE hConsoleOutput,
  665. IN CONST VOID *lpBuffer,
  666. IN DWORD nNumberOfCharsToWrite,
  667. OUT LPDWORD lpNumberOfCharsWritten,
  668. IN LPVOID lpReserved
  669. );
  670. #ifdef UNICODE
  671. #define WriteConsole WriteConsoleW
  672. #else
  673. #define WriteConsole WriteConsoleA
  674. #endif // !UNICODE
  675. #define CONSOLE_TEXTMODE_BUFFER 1
  676. WINBASEAPI
  677. HANDLE
  678. WINAPI
  679. CreateConsoleScreenBuffer(
  680. IN DWORD dwDesiredAccess,
  681. IN DWORD dwShareMode,
  682. IN CONST SECURITY_ATTRIBUTES *lpSecurityAttributes,
  683. IN DWORD dwFlags,
  684. IN LPVOID lpScreenBufferData
  685. );
  686. WINBASEAPI
  687. UINT
  688. WINAPI
  689. GetConsoleCP( VOID );
  690. WINBASEAPI
  691. BOOL
  692. WINAPI
  693. SetConsoleCP(
  694. IN UINT wCodePageID
  695. );
  696. WINBASEAPI
  697. UINT
  698. WINAPI
  699. GetConsoleOutputCP( VOID );
  700. WINBASEAPI
  701. BOOL
  702. WINAPI
  703. SetConsoleOutputCP(
  704. IN UINT wCodePageID
  705. );
  706. #if(_WIN32_WINNT >= 0x0500)
  707. #define CONSOLE_FULLSCREEN 1 // fullscreen console
  708. #define CONSOLE_FULLSCREEN_HARDWARE 2 // console owns the hardware
  709. WINBASEAPI
  710. BOOL
  711. APIENTRY
  712. GetConsoleDisplayMode(
  713. OUT LPDWORD lpModeFlags
  714. );
  715. WINBASEAPI
  716. HWND
  717. APIENTRY
  718. GetConsoleWindow(
  719. VOID
  720. );
  721. #endif /* _WIN32_WINNT >= 0x0500 */
  722. #if(_WIN32_WINNT >= 0x0501)
  723. WINBASEAPI
  724. DWORD
  725. APIENTRY
  726. GetConsoleProcessList(
  727. OUT LPDWORD lpdwProcessList,
  728. IN DWORD dwProcessCount);
  729. //
  730. // Aliasing apis.
  731. //
  732. WINBASEAPI
  733. BOOL
  734. APIENTRY
  735. AddConsoleAliasA(
  736. IN LPSTR Source,
  737. IN LPSTR Target,
  738. IN LPSTR ExeName);
  739. WINBASEAPI
  740. BOOL
  741. APIENTRY
  742. AddConsoleAliasW(
  743. IN LPWSTR Source,
  744. IN LPWSTR Target,
  745. IN LPWSTR ExeName);
  746. #ifdef UNICODE
  747. #define AddConsoleAlias AddConsoleAliasW
  748. #else
  749. #define AddConsoleAlias AddConsoleAliasA
  750. #endif // !UNICODE
  751. WINBASEAPI
  752. DWORD
  753. APIENTRY
  754. GetConsoleAliasA(
  755. IN LPSTR Source,
  756. OUT LPSTR TargetBuffer,
  757. IN DWORD TargetBufferLength,
  758. IN LPSTR ExeName);
  759. WINBASEAPI
  760. DWORD
  761. APIENTRY
  762. GetConsoleAliasW(
  763. IN LPWSTR Source,
  764. OUT LPWSTR TargetBuffer,
  765. IN DWORD TargetBufferLength,
  766. IN LPWSTR ExeName);
  767. #ifdef UNICODE
  768. #define GetConsoleAlias GetConsoleAliasW
  769. #else
  770. #define GetConsoleAlias GetConsoleAliasA
  771. #endif // !UNICODE
  772. WINBASEAPI
  773. DWORD
  774. APIENTRY
  775. GetConsoleAliasesLengthA(
  776. IN LPSTR ExeName);
  777. WINBASEAPI
  778. DWORD
  779. APIENTRY
  780. GetConsoleAliasesLengthW(
  781. IN LPWSTR ExeName);
  782. #ifdef UNICODE
  783. #define GetConsoleAliasesLength GetConsoleAliasesLengthW
  784. #else
  785. #define GetConsoleAliasesLength GetConsoleAliasesLengthA
  786. #endif // !UNICODE
  787. WINBASEAPI
  788. DWORD
  789. APIENTRY
  790. GetConsoleAliasExesLengthA(
  791. VOID);
  792. WINBASEAPI
  793. DWORD
  794. APIENTRY
  795. GetConsoleAliasExesLengthW(
  796. VOID);
  797. #ifdef UNICODE
  798. #define GetConsoleAliasExesLength GetConsoleAliasExesLengthW
  799. #else
  800. #define GetConsoleAliasExesLength GetConsoleAliasExesLengthA
  801. #endif // !UNICODE
  802. WINBASEAPI
  803. DWORD
  804. APIENTRY
  805. GetConsoleAliasesA(
  806. OUT LPSTR AliasBuffer,
  807. IN DWORD AliasBufferLength,
  808. IN LPSTR ExeName);
  809. WINBASEAPI
  810. DWORD
  811. APIENTRY
  812. GetConsoleAliasesW(
  813. OUT LPWSTR AliasBuffer,
  814. IN DWORD AliasBufferLength,
  815. IN LPWSTR ExeName);
  816. #ifdef UNICODE
  817. #define GetConsoleAliases GetConsoleAliasesW
  818. #else
  819. #define GetConsoleAliases GetConsoleAliasesA
  820. #endif // !UNICODE
  821. WINBASEAPI
  822. DWORD
  823. APIENTRY
  824. GetConsoleAliasExesA(
  825. OUT LPSTR ExeNameBuffer,
  826. IN DWORD ExeNameBufferLength);
  827. WINBASEAPI
  828. DWORD
  829. APIENTRY
  830. GetConsoleAliasExesW(
  831. OUT LPWSTR ExeNameBuffer,
  832. IN DWORD ExeNameBufferLength);
  833. #ifdef UNICODE
  834. #define GetConsoleAliasExes GetConsoleAliasExesW
  835. #else
  836. #define GetConsoleAliasExes GetConsoleAliasExesA
  837. #endif // !UNICODE
  838. #endif /* _WIN32_WINNT >= 0x0501 */
  839. #ifdef __cplusplus
  840. }
  841. #endif
  842. #endif // _WINCON_