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.

438 lines
9.0 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. #endif /* FE_SB */
  31. BOOL
  32. WINAPI
  33. VDMConsoleOperation(
  34. IN DWORD iFunction,
  35. IN OUT LPVOID lpData
  36. );
  37. BOOL
  38. WINAPI
  39. SetConsoleIcon(
  40. IN HICON hIcon
  41. );
  42. //
  43. // These console font APIs don't appear to be used anywhere. Maybe they
  44. // should be removed.
  45. //
  46. BOOL
  47. WINAPI
  48. SetConsoleFont(
  49. IN HANDLE hConsoleOutput,
  50. IN DWORD nFont
  51. );
  52. DWORD
  53. WINAPI
  54. GetConsoleFontInfo(
  55. IN HANDLE hConsoleOutput,
  56. IN BOOL bMaximumWindow,
  57. IN DWORD nLength,
  58. OUT PCONSOLE_FONT_INFO lpConsoleFontInfo
  59. );
  60. DWORD
  61. WINAPI
  62. GetNumberOfConsoleFonts(
  63. VOID
  64. );
  65. BOOL
  66. WINAPI
  67. SetConsoleCursor(
  68. IN HANDLE hConsoleOutput,
  69. IN HCURSOR hCursor
  70. );
  71. int
  72. WINAPI
  73. ShowConsoleCursor(
  74. IN HANDLE hConsoleOutput,
  75. IN BOOL bShow
  76. );
  77. HMENU
  78. APIENTRY
  79. ConsoleMenuControl(
  80. IN HANDLE hConsoleOutput,
  81. IN UINT dwCommandIdLow,
  82. IN UINT dwCommandIdHigh
  83. );
  84. BOOL
  85. SetConsolePalette(
  86. IN HANDLE hConsoleOutput,
  87. IN HPALETTE hPalette,
  88. IN UINT dwUsage
  89. );
  90. #define CONSOLE_FULLSCREEN_MODE 1
  91. #define CONSOLE_WINDOWED_MODE 2
  92. BOOL
  93. APIENTRY
  94. SetConsoleDisplayMode(
  95. IN HANDLE hConsoleOutput,
  96. IN DWORD dwFlags,
  97. OUT PCOORD lpNewScreenBufferDimensions
  98. );
  99. #define CONSOLE_UNREGISTER_VDM 0
  100. #define CONSOLE_REGISTER_VDM 1
  101. #define CONSOLE_REGISTER_WOW 2
  102. BOOL
  103. APIENTRY
  104. RegisterConsoleVDM(
  105. IN DWORD dwRegisterFlags,
  106. IN HANDLE hStartHardwareEvent,
  107. IN HANDLE hEndHardwareEvent,
  108. IN HANDLE hErrorhardwareEvent,
  109. IN DWORD Reserved,
  110. OUT LPDWORD lpStateLength,
  111. OUT PVOID *lpState,
  112. IN LPWSTR lpVDMBufferSectionName,
  113. IN DWORD dwVDMBufferSectionNameLength,
  114. IN COORD VDMBufferSize OPTIONAL,
  115. OUT PVOID *lpVDMBuffer
  116. );
  117. BOOL
  118. APIENTRY
  119. GetConsoleHardwareState(
  120. IN HANDLE hConsoleOutput,
  121. OUT PCOORD lpResolution,
  122. OUT PCOORD lpFontSize
  123. );
  124. BOOL
  125. APIENTRY
  126. SetConsoleHardwareState(
  127. IN HANDLE hConsoleOutput,
  128. IN COORD dwResolution,
  129. IN COORD dwFontSize
  130. );
  131. VOID
  132. ExpungeConsoleCommandHistoryA(
  133. IN LPSTR ExeName);
  134. VOID
  135. ExpungeConsoleCommandHistoryW(
  136. IN LPWSTR ExeName);
  137. #ifdef UNICODE
  138. #define ExpungeConsoleCommandHistory ExpungeConsoleCommandHistoryW
  139. #else
  140. #define ExpungeConsoleCommandHistory ExpungeConsoleCommandHistoryA
  141. #endif // !UNICODE
  142. BOOL
  143. SetConsoleNumberOfCommandsA(
  144. IN DWORD Number,
  145. IN LPSTR ExeName);
  146. BOOL
  147. SetConsoleNumberOfCommandsW(
  148. IN DWORD Number,
  149. IN LPWSTR ExeName);
  150. #ifdef UNICODE
  151. #define SetConsoleNumberOfCommands SetConsoleNumberOfCommandsW
  152. #else
  153. #define SetConsoleNumberOfCommands SetConsoleNumberOfCommandsA
  154. #endif // !UNICODE
  155. DWORD
  156. GetConsoleCommandHistoryLengthA(
  157. IN LPSTR ExeName);
  158. DWORD
  159. GetConsoleCommandHistoryLengthW(
  160. IN LPWSTR ExeName);
  161. #ifdef UNICODE
  162. #define GetConsoleCommandHistoryLength GetConsoleCommandHistoryLengthW
  163. #else
  164. #define GetConsoleCommandHistoryLength GetConsoleCommandHistoryLengthA
  165. #endif // !UNICODE
  166. DWORD
  167. GetConsoleCommandHistoryA(
  168. OUT LPSTR Commands,
  169. IN DWORD CommandBufferLength,
  170. IN LPSTR ExeName);
  171. DWORD
  172. GetConsoleCommandHistoryW(
  173. OUT LPWSTR Commands,
  174. IN DWORD CommandBufferLength,
  175. IN LPWSTR ExeName);
  176. #ifdef UNICODE
  177. #define GetConsoleCommandHistory GetConsoleCommandHistoryW
  178. #else
  179. #define GetConsoleCommandHistory GetConsoleCommandHistoryA
  180. #endif // !UNICODE
  181. #define CONSOLE_OVERSTRIKE 1
  182. BOOL
  183. APIENTRY
  184. SetConsoleCommandHistoryMode(
  185. IN DWORD Flags
  186. );
  187. #define CONSOLE_NOSHORTCUTKEY 0 /* no shortcut key */
  188. #define CONSOLE_ALTTAB 1 /* Alt + Tab */
  189. #define CONSOLE_ALTESC (1 << 1) /* Alt + Escape */
  190. #define CONSOLE_ALTSPACE (1 << 2) /* Alt + Space */
  191. #define CONSOLE_ALTENTER (1 << 3) /* Alt + Enter */
  192. #define CONSOLE_ALTPRTSC (1 << 4) /* Alt Print screen */
  193. #define CONSOLE_PRTSC (1 << 5) /* Print screen */
  194. #define CONSOLE_CTRLESC (1 << 6) /* Ctrl + Escape */
  195. typedef struct _APPKEY {
  196. WORD Modifier;
  197. WORD ScanCode;
  198. } APPKEY, *LPAPPKEY;
  199. #define CONSOLE_MODIFIER_SHIFT 0x0003 // Left shift key
  200. #define CONSOLE_MODIFIER_CONTROL 0x0004 // Either Control shift key
  201. #define CONSOLE_MODIFIER_ALT 0x0008 // Either Alt shift key
  202. BOOL
  203. APIENTRY
  204. SetConsoleKeyShortcuts(
  205. IN BOOL bSet,
  206. IN BYTE bReserveKeys,
  207. IN LPAPPKEY lpAppKeys,
  208. IN DWORD dwNumAppKeys
  209. );
  210. BOOL
  211. APIENTRY
  212. SetConsoleMenuClose(
  213. IN BOOL bEnable
  214. );
  215. DWORD
  216. GetConsoleInputExeNameA(
  217. IN DWORD nBufferLength,
  218. OUT LPSTR lpBuffer
  219. );
  220. DWORD
  221. GetConsoleInputExeNameW(
  222. IN DWORD nBufferLength,
  223. OUT LPWSTR lpBuffer
  224. );
  225. #ifdef UNICODE
  226. #define GetConsoleInputExeName GetConsoleInputExeNameW
  227. #else
  228. #define GetConsoleInputExeName GetConsoleInputExeNameA
  229. #endif // !UNICODE
  230. BOOL
  231. SetConsoleInputExeNameA(
  232. IN LPSTR lpExeName
  233. );
  234. BOOL
  235. SetConsoleInputExeNameW(
  236. IN LPWSTR lpExeName
  237. );
  238. #ifdef UNICODE
  239. #define SetConsoleInputExeName SetConsoleInputExeNameW
  240. #else
  241. #define SetConsoleInputExeName SetConsoleInputExeNameA
  242. #endif // !UNICODE
  243. typedef struct _CONSOLE_READCONSOLE_CONTROL {
  244. IN ULONG nLength; // sizeof( CONSOLE_READCONSOLE_CONTROL )
  245. IN ULONG nInitialChars;
  246. IN ULONG dwCtrlWakeupMask;
  247. OUT ULONG dwControlKeyState;
  248. } CONSOLE_READCONSOLE_CONTROL, *PCONSOLE_READCONSOLE_CONTROL;
  249. #define CONSOLE_ADD_SUBST 1
  250. #define CONSOLE_REMOVE_SUBST 2
  251. #define CONSOLE_QUERY_SUBST 3
  252. BOOL
  253. ConsoleSubst(
  254. IN DWORD dwDriveNumber,
  255. IN DWORD dwFlag,
  256. IN OUT LPWSTR lpPhysicalDriveBuffer,
  257. IN DWORD dwPhysicalDriveBufferLength
  258. );
  259. #define CONSOLE_READ_NOREMOVE 0x0001
  260. #define CONSOLE_READ_NOWAIT 0x0002
  261. #define CONSOLE_READ_VALID (CONSOLE_READ_NOREMOVE | CONSOLE_READ_NOWAIT)
  262. BOOL
  263. WINAPI
  264. ReadConsoleInputExA(
  265. HANDLE hConsoleInput,
  266. PINPUT_RECORD lpBuffer,
  267. DWORD nLength,
  268. LPDWORD lpNumberOfEventsRead,
  269. USHORT wFlags
  270. );
  271. BOOL
  272. WINAPI
  273. ReadConsoleInputExW(
  274. HANDLE hConsoleInput,
  275. PINPUT_RECORD lpBuffer,
  276. DWORD nLength,
  277. LPDWORD lpNumberOfEventsRead,
  278. USHORT wFlags
  279. );
  280. #ifdef UNICODE
  281. #define ReadConsoleInputEx ReadConsoleInputExW
  282. #else
  283. #define ReadConsoleInputEx ReadConsoleInputExA
  284. #endif // !UNICODE
  285. BOOL
  286. WINAPI
  287. WriteConsoleInputVDMA(
  288. HANDLE hConsoleInput,
  289. PINPUT_RECORD lpBuffer,
  290. DWORD nLength,
  291. LPDWORD lpNumberOfEventsWritten
  292. );
  293. BOOL
  294. WINAPI
  295. WriteConsoleInputVDMW(
  296. HANDLE hConsoleInput,
  297. PINPUT_RECORD lpBuffer,
  298. DWORD nLength,
  299. LPDWORD lpNumberOfEventsWritten
  300. );
  301. #ifdef UNICODE
  302. #define WriteConsoleInputVDM WriteConsoleInputVDMW
  303. #else
  304. #define WriteConsoleInputVDM WriteConsoleInputVDMA
  305. #endif // !UNICODE
  306. #if defined(FE_SB)
  307. BOOL
  308. APIENTRY
  309. GetConsoleNlsMode(
  310. IN HANDLE hConsole,
  311. OUT PDWORD lpdwNlsMode
  312. );
  313. BOOL
  314. APIENTRY
  315. SetConsoleNlsMode(
  316. IN HANDLE hConsole,
  317. IN DWORD fdwNlsMode
  318. );
  319. BOOL
  320. APIENTRY
  321. GetConsoleCharType(
  322. IN HANDLE hConsole,
  323. IN COORD coordCheck,
  324. OUT PDWORD pdwType
  325. );
  326. #define CHAR_TYPE_SBCS 0 // Displayed SBCS character
  327. #define CHAR_TYPE_LEADING 2 // Displayed leading byte of DBCS
  328. #define CHAR_TYPE_TRAILING 3 // Displayed trailing byte of DBCS
  329. BOOL
  330. APIENTRY
  331. SetConsoleLocalEUDC(
  332. IN HANDLE hConsoleHandle,
  333. IN WORD wCodePoint,
  334. IN COORD cFontSize,
  335. IN PCHAR lpSB
  336. );
  337. BOOL
  338. APIENTRY
  339. SetConsoleCursorMode(
  340. IN HANDLE hConsoleHandle,
  341. IN BOOL Blink,
  342. IN BOOL DBEnable
  343. );
  344. BOOL
  345. APIENTRY
  346. GetConsoleCursorMode(
  347. IN HANDLE hConsoleHandle,
  348. OUT PBOOL pbBlink,
  349. OUT PBOOL pbDBEnable
  350. );
  351. BOOL
  352. APIENTRY
  353. RegisterConsoleOS2(
  354. IN BOOL fOs2Register
  355. );
  356. BOOL
  357. APIENTRY
  358. SetConsoleOS2OemFormat(
  359. IN BOOL fOs2OemFormat
  360. );
  361. BOOL
  362. IsConsoleFullWidth(
  363. IN HDC hDC,
  364. IN DWORD CodePage,
  365. IN WCHAR wch
  366. );
  367. #if defined(FE_IME)
  368. BOOL
  369. APIENTRY
  370. RegisterConsoleIME(
  371. IN HWND hWndConsoleIME,
  372. OUT DWORD *dwConsoleThreadId
  373. );
  374. BOOL
  375. APIENTRY
  376. UnregisterConsoleIME(
  377. );
  378. #endif // FE_IME
  379. #endif // FE_SB