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.

559 lines
11 KiB

  1. #ifndef NOGDI
  2. typedef struct _CONSOLE_GRAPHICS_BUFFER_INFO {
  3. DWORD dwBitMapInfoLength;
  4. LPBITMAPINFO lpBitMapInfo;
  5. DWORD dwUsage;
  6. HANDLE hMutex;
  7. PVOID lpBitMap;
  8. } CONSOLE_GRAPHICS_BUFFER_INFO, *PCONSOLE_GRAPHICS_BUFFER_INFO;
  9. #endif // NOGDI
  10. #define CONSOLE_GRAPHICS_BUFFER 2
  11. BOOL
  12. WINAPI
  13. InvalidateConsoleDIBits(
  14. IN HANDLE hConsoleOutput,
  15. IN PSMALL_RECT lpRect
  16. );
  17. #define SYSTEM_ROOT_CONSOLE_EVENT 3
  18. VOID
  19. WINAPI
  20. SetLastConsoleEventActive( VOID );
  21. #define VDM_HIDE_WINDOW 1
  22. #define VDM_IS_ICONIC 2
  23. #define VDM_CLIENT_RECT 3
  24. #define VDM_CLIENT_TO_SCREEN 4
  25. #define VDM_SCREEN_TO_CLIENT 5
  26. #define VDM_IS_HIDDEN 6
  27. #define VDM_FULLSCREEN_NOPAINT 7
  28. #if defined(FE_SB)
  29. #define VDM_SET_VIDEO_MODE 8
  30. #if defined(i386)
  31. #define VDM_SAVE_RESTORE_HW_STATE 9
  32. #define VDM_VIDEO_IOCTL 10
  33. typedef struct _VDM_IOCTL_PARAM {
  34. DWORD dwIoControlCode;
  35. LPVOID lpvInBuffer;
  36. DWORD cbInBuffer;
  37. LPVOID lpvOutBuffer;
  38. DWORD cbOutBuffer;
  39. } VDM_IOCTL_PARAM, *LPVDM_IOCTL_PARAM;
  40. #endif /* i386 */
  41. #endif /* FE_SB */
  42. BOOL
  43. WINAPI
  44. VDMConsoleOperation(
  45. IN DWORD iFunction,
  46. IN OUT LPVOID lpData
  47. );
  48. BOOL
  49. WINAPI
  50. SetConsoleIcon(
  51. IN HICON hIcon
  52. );
  53. //
  54. // These console font APIs don't appear to be used anywhere. Maybe they
  55. // should be removed.
  56. //
  57. BOOL
  58. WINAPI
  59. SetConsoleFont(
  60. IN HANDLE hConsoleOutput,
  61. IN DWORD nFont
  62. );
  63. DWORD
  64. WINAPI
  65. GetConsoleFontInfo(
  66. IN HANDLE hConsoleOutput,
  67. IN BOOL bMaximumWindow,
  68. IN DWORD nLength,
  69. OUT PCONSOLE_FONT_INFO lpConsoleFontInfo
  70. );
  71. DWORD
  72. WINAPI
  73. GetNumberOfConsoleFonts(
  74. VOID
  75. );
  76. BOOL
  77. WINAPI
  78. SetConsoleCursor(
  79. IN HANDLE hConsoleOutput,
  80. IN HCURSOR hCursor
  81. );
  82. int
  83. WINAPI
  84. ShowConsoleCursor(
  85. IN HANDLE hConsoleOutput,
  86. IN BOOL bShow
  87. );
  88. HMENU
  89. APIENTRY
  90. ConsoleMenuControl(
  91. IN HANDLE hConsoleOutput,
  92. IN UINT dwCommandIdLow,
  93. IN UINT dwCommandIdHigh
  94. );
  95. BOOL
  96. SetConsolePalette(
  97. IN HANDLE hConsoleOutput,
  98. IN HPALETTE hPalette,
  99. IN UINT dwUsage
  100. );
  101. #define CONSOLE_FULLSCREEN_MODE 1
  102. #define CONSOLE_WINDOWED_MODE 2
  103. BOOL
  104. APIENTRY
  105. SetConsoleDisplayMode(
  106. IN HANDLE hConsoleOutput,
  107. IN DWORD dwFlags,
  108. OUT PCOORD lpNewScreenBufferDimensions
  109. );
  110. #define CONSOLE_UNREGISTER_VDM 0
  111. #define CONSOLE_REGISTER_VDM 1
  112. #define CONSOLE_REGISTER_WOW 2
  113. BOOL
  114. APIENTRY
  115. RegisterConsoleVDM(
  116. IN DWORD dwRegisterFlags,
  117. IN HANDLE hStartHardwareEvent,
  118. IN HANDLE hEndHardwareEvent,
  119. IN HANDLE hErrorhardwareEvent,
  120. IN DWORD Reserved,
  121. OUT LPDWORD lpStateLength,
  122. OUT PVOID *lpState,
  123. IN LPWSTR lpVDMBufferSectionName,
  124. IN DWORD dwVDMBufferSectionNameLength,
  125. IN COORD VDMBufferSize OPTIONAL,
  126. OUT PVOID *lpVDMBuffer
  127. );
  128. BOOL
  129. APIENTRY
  130. GetConsoleHardwareState(
  131. IN HANDLE hConsoleOutput,
  132. OUT PCOORD lpResolution,
  133. OUT PCOORD lpFontSize
  134. );
  135. BOOL
  136. APIENTRY
  137. SetConsoleHardwareState(
  138. IN HANDLE hConsoleOutput,
  139. IN COORD dwResolution,
  140. IN COORD dwFontSize
  141. );
  142. //
  143. // aliasing apis
  144. //
  145. BOOL
  146. AddConsoleAliasA(
  147. IN LPSTR Source,
  148. IN LPSTR Target,
  149. IN LPSTR ExeName
  150. );
  151. BOOL
  152. AddConsoleAliasW(
  153. IN LPWSTR Source,
  154. IN LPWSTR Target,
  155. IN LPWSTR ExeName
  156. );
  157. #ifdef UNICODE
  158. #define AddConsoleAlias AddConsoleAliasW
  159. #else
  160. #define AddConsoleAlias AddConsoleAliasA
  161. #endif // !UNICODE
  162. DWORD
  163. GetConsoleAliasA(
  164. IN LPSTR Source,
  165. OUT LPSTR TargetBuffer,
  166. IN DWORD TargetBufferLength,
  167. IN LPSTR ExeName
  168. );
  169. DWORD
  170. GetConsoleAliasW(
  171. IN LPWSTR Source,
  172. OUT LPWSTR TargetBuffer,
  173. IN DWORD TargetBufferLength,
  174. IN LPWSTR ExeName
  175. );
  176. #ifdef UNICODE
  177. #define GetConsoleAlias GetConsoleAliasW
  178. #else
  179. #define GetConsoleAlias GetConsoleAliasA
  180. #endif // !UNICODE
  181. DWORD
  182. GetConsoleAliasesLengthA(
  183. IN LPSTR ExeName
  184. );
  185. DWORD
  186. GetConsoleAliasesLengthW(
  187. IN LPWSTR ExeName
  188. );
  189. #ifdef UNICODE
  190. #define GetConsoleAliasesLength GetConsoleAliasesLengthW
  191. #else
  192. #define GetConsoleAliasesLength GetConsoleAliasesLengthA
  193. #endif // !UNICODE
  194. DWORD
  195. GetConsoleAliasExesLengthA( VOID );
  196. DWORD
  197. GetConsoleAliasExesLengthW( VOID );
  198. #ifdef UNICODE
  199. #define GetConsoleAliasExesLength GetConsoleAliasExesLengthW
  200. #else
  201. #define GetConsoleAliasExesLength GetConsoleAliasExesLengthA
  202. #endif // !UNICODE
  203. DWORD
  204. GetConsoleAliasesA(
  205. OUT LPSTR AliasBuffer,
  206. IN DWORD AliasBufferLength,
  207. IN LPSTR ExeName
  208. );
  209. DWORD
  210. GetConsoleAliasesW(
  211. OUT LPWSTR AliasBuffer,
  212. IN DWORD AliasBufferLength,
  213. IN LPWSTR ExeName
  214. );
  215. #ifdef UNICODE
  216. #define GetConsoleAliases GetConsoleAliasesW
  217. #else
  218. #define GetConsoleAliases GetConsoleAliasesA
  219. #endif // !UNICODE
  220. DWORD
  221. GetConsoleAliasExesA(
  222. OUT LPSTR ExeNameBuffer,
  223. IN DWORD ExeNameBufferLength
  224. );
  225. DWORD
  226. GetConsoleAliasExesW(
  227. OUT LPWSTR ExeNameBuffer,
  228. IN DWORD ExeNameBufferLength
  229. );
  230. #ifdef UNICODE
  231. #define GetConsoleAliasExes GetConsoleAliasExesW
  232. #else
  233. #define GetConsoleAliasExes GetConsoleAliasExesA
  234. #endif // !UNICODE
  235. VOID
  236. ExpungeConsoleCommandHistoryA(
  237. IN LPSTR ExeName
  238. );
  239. VOID
  240. ExpungeConsoleCommandHistoryW(
  241. IN LPWSTR ExeName
  242. );
  243. #ifdef UNICODE
  244. #define ExpungeConsoleCommandHistory ExpungeConsoleCommandHistoryW
  245. #else
  246. #define ExpungeConsoleCommandHistory ExpungeConsoleCommandHistoryA
  247. #endif // !UNICODE
  248. BOOL
  249. SetConsoleNumberOfCommandsA(
  250. IN DWORD Number,
  251. IN LPSTR ExeName
  252. );
  253. BOOL
  254. SetConsoleNumberOfCommandsW(
  255. IN DWORD Number,
  256. IN LPWSTR ExeName
  257. );
  258. #ifdef UNICODE
  259. #define SetConsoleNumberOfCommands SetConsoleNumberOfCommandsW
  260. #else
  261. #define SetConsoleNumberOfCommands SetConsoleNumberOfCommandsA
  262. #endif // !UNICODE
  263. DWORD
  264. GetConsoleCommandHistoryLengthA(
  265. IN LPSTR ExeName
  266. );
  267. DWORD
  268. GetConsoleCommandHistoryLengthW(
  269. IN LPWSTR ExeName
  270. );
  271. #ifdef UNICODE
  272. #define GetConsoleCommandHistoryLength GetConsoleCommandHistoryLengthW
  273. #else
  274. #define GetConsoleCommandHistoryLength GetConsoleCommandHistoryLengthA
  275. #endif // !UNICODE
  276. DWORD
  277. GetConsoleCommandHistoryA(
  278. OUT LPSTR Commands,
  279. IN DWORD CommandBufferLength,
  280. IN LPSTR ExeName
  281. );
  282. DWORD
  283. GetConsoleCommandHistoryW(
  284. OUT LPWSTR Commands,
  285. IN DWORD CommandBufferLength,
  286. IN LPWSTR ExeName
  287. );
  288. #ifdef UNICODE
  289. #define GetConsoleCommandHistory GetConsoleCommandHistoryW
  290. #else
  291. #define GetConsoleCommandHistory GetConsoleCommandHistoryA
  292. #endif // !UNICODE
  293. #define CONSOLE_OVERSTRIKE 1
  294. BOOL
  295. APIENTRY
  296. SetConsoleCommandHistoryMode(
  297. IN DWORD Flags
  298. );
  299. #define CONSOLE_NOSHORTCUTKEY 0 /* no shortcut key */
  300. #define CONSOLE_ALTTAB 1 /* Alt + Tab */
  301. #define CONSOLE_ALTESC (1 << 1) /* Alt + Escape */
  302. #define CONSOLE_ALTSPACE (1 << 2) /* Alt + Space */
  303. #define CONSOLE_ALTENTER (1 << 3) /* Alt + Enter */
  304. #define CONSOLE_ALTPRTSC (1 << 4) /* Alt Print screen */
  305. #define CONSOLE_PRTSC (1 << 5) /* Print screen */
  306. #define CONSOLE_CTRLESC (1 << 6) /* Ctrl + Escape */
  307. typedef struct _APPKEY {
  308. WORD Modifier;
  309. WORD ScanCode;
  310. } APPKEY, *LPAPPKEY;
  311. #define CONSOLE_MODIFIER_SHIFT 0x0003 // Left shift key
  312. #define CONSOLE_MODIFIER_CONTROL 0x0004 // Either Control shift key
  313. #define CONSOLE_MODIFIER_ALT 0x0008 // Either Alt shift key
  314. BOOL
  315. APIENTRY
  316. SetConsoleKeyShortcuts(
  317. IN BOOL bSet,
  318. IN BYTE bReserveKeys,
  319. IN LPAPPKEY lpAppKeys,
  320. IN DWORD dwNumAppKeys
  321. );
  322. BOOL
  323. APIENTRY
  324. SetConsoleMenuClose(
  325. IN BOOL bEnable
  326. );
  327. DWORD
  328. GetConsoleInputExeNameA(
  329. IN DWORD nBufferLength,
  330. OUT LPSTR lpBuffer
  331. );
  332. DWORD
  333. GetConsoleInputExeNameW(
  334. IN DWORD nBufferLength,
  335. OUT LPWSTR lpBuffer
  336. );
  337. #ifdef UNICODE
  338. #define GetConsoleInputExeName GetConsoleInputExeNameW
  339. #else
  340. #define GetConsoleInputExeName GetConsoleInputExeNameA
  341. #endif // !UNICODE
  342. BOOL
  343. SetConsoleInputExeNameA(
  344. IN LPSTR lpExeName
  345. );
  346. BOOL
  347. SetConsoleInputExeNameW(
  348. IN LPWSTR lpExeName
  349. );
  350. #ifdef UNICODE
  351. #define SetConsoleInputExeName SetConsoleInputExeNameW
  352. #else
  353. #define SetConsoleInputExeName SetConsoleInputExeNameA
  354. #endif // !UNICODE
  355. typedef struct _CONSOLE_READCONSOLE_CONTROL {
  356. IN ULONG nLength; // sizeof( CONSOLE_READCONSOLE_CONTROL )
  357. IN ULONG nInitialChars;
  358. IN ULONG dwCtrlWakeupMask;
  359. OUT ULONG dwControlKeyState;
  360. } CONSOLE_READCONSOLE_CONTROL, *PCONSOLE_READCONSOLE_CONTROL;
  361. #define CONSOLE_ADD_SUBST 1
  362. #define CONSOLE_REMOVE_SUBST 2
  363. #define CONSOLE_QUERY_SUBST 3
  364. BOOL
  365. ConsoleSubst(
  366. IN DWORD dwDriveNumber,
  367. IN DWORD dwFlag,
  368. IN OUT LPWSTR lpPhysicalDriveBuffer,
  369. IN DWORD dwPhysicalDriveBufferLength
  370. );
  371. #define CONSOLE_READ_NOREMOVE 0x0001
  372. #define CONSOLE_READ_NOWAIT 0x0002
  373. #define CONSOLE_READ_VALID (CONSOLE_READ_NOREMOVE | CONSOLE_READ_NOWAIT)
  374. BOOL
  375. WINAPI
  376. ReadConsoleInputExA(
  377. HANDLE hConsoleInput,
  378. PINPUT_RECORD lpBuffer,
  379. DWORD nLength,
  380. LPDWORD lpNumberOfEventsRead,
  381. USHORT wFlags
  382. );
  383. BOOL
  384. WINAPI
  385. ReadConsoleInputExW(
  386. HANDLE hConsoleInput,
  387. PINPUT_RECORD lpBuffer,
  388. DWORD nLength,
  389. LPDWORD lpNumberOfEventsRead,
  390. USHORT wFlags
  391. );
  392. #ifdef UNICODE
  393. #define ReadConsoleInputEx ReadConsoleInputExW
  394. #else
  395. #define ReadConsoleInputEx ReadConsoleInputExA
  396. #endif // !UNICODE
  397. BOOL
  398. WINAPI
  399. WriteConsoleInputVDMA(
  400. HANDLE hConsoleInput,
  401. PINPUT_RECORD lpBuffer,
  402. DWORD nLength,
  403. LPDWORD lpNumberOfEventsWritten
  404. );
  405. BOOL
  406. WINAPI
  407. WriteConsoleInputVDMW(
  408. HANDLE hConsoleInput,
  409. PINPUT_RECORD lpBuffer,
  410. DWORD nLength,
  411. LPDWORD lpNumberOfEventsWritten
  412. );
  413. #ifdef UNICODE
  414. #define WriteConsoleInputVDM WriteConsoleInputVDMW
  415. #else
  416. #define WriteConsoleInputVDM WriteConsoleInputVDMA
  417. #endif // !UNICODE
  418. #if defined(FE_SB)
  419. BOOL
  420. APIENTRY
  421. GetConsoleNlsMode(
  422. IN HANDLE hConsole,
  423. OUT PDWORD lpdwNlsMode
  424. );
  425. BOOL
  426. APIENTRY
  427. SetConsoleNlsMode(
  428. IN HANDLE hConsole,
  429. IN DWORD fdwNlsMode
  430. );
  431. BOOL
  432. APIENTRY
  433. GetConsoleCharType(
  434. IN HANDLE hConsole,
  435. IN COORD coordCheck,
  436. OUT PDWORD pdwType
  437. );
  438. #define CHAR_TYPE_SBCS 0 // Displayed SBCS character
  439. #define CHAR_TYPE_LEADING 2 // Displayed leading byte of DBCS
  440. #define CHAR_TYPE_TRAILING 3 // Displayed trailing byte of DBCS
  441. BOOL
  442. APIENTRY
  443. SetConsoleLocalEUDC(
  444. IN HANDLE hConsoleHandle,
  445. IN WORD wCodePoint,
  446. IN COORD cFontSize,
  447. IN PCHAR lpSB
  448. );
  449. BOOL
  450. APIENTRY
  451. SetConsoleCursorMode(
  452. IN HANDLE hConsoleHandle,
  453. IN BOOL Blink,
  454. IN BOOL DBEnable
  455. );
  456. BOOL
  457. APIENTRY
  458. GetConsoleCursorMode(
  459. IN HANDLE hConsoleHandle,
  460. OUT PBOOL pbBlink,
  461. OUT PBOOL pbDBEnable
  462. );
  463. BOOL
  464. APIENTRY
  465. RegisterConsoleOS2(
  466. IN BOOL fOs2Register
  467. );
  468. BOOL
  469. APIENTRY
  470. SetConsoleOS2OemFormat(
  471. IN BOOL fOs2OemFormat
  472. );
  473. BOOL
  474. IsConsoleFullWidth(
  475. IN HDC hDC,
  476. IN DWORD CodePage,
  477. IN WCHAR wch
  478. );
  479. #if defined(FE_IME)
  480. BOOL
  481. APIENTRY
  482. RegisterConsoleIME(
  483. IN HWND hWndConsoleIME,
  484. OUT DWORD *dwConsoleThreadId
  485. );
  486. BOOL
  487. APIENTRY
  488. UnregisterConsoleIME(
  489. );
  490. #endif // FE_IME
  491. #endif // FE_SB