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.

357 lines
6.9 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. ExpungeConsoleCommandHistory%(
  133. IN LPTSTR% ExeName);
  134. BOOL
  135. SetConsoleNumberOfCommands%(
  136. IN DWORD Number,
  137. IN LPTSTR% ExeName);
  138. DWORD
  139. GetConsoleCommandHistoryLength%(
  140. IN LPTSTR% ExeName);
  141. DWORD
  142. GetConsoleCommandHistory%(
  143. OUT LPTSTR% Commands,
  144. IN DWORD CommandBufferLength,
  145. IN LPTSTR% ExeName);
  146. #define CONSOLE_OVERSTRIKE 1
  147. BOOL
  148. APIENTRY
  149. SetConsoleCommandHistoryMode(
  150. IN DWORD Flags
  151. );
  152. #define CONSOLE_NOSHORTCUTKEY 0 /* no shortcut key */
  153. #define CONSOLE_ALTTAB 1 /* Alt + Tab */
  154. #define CONSOLE_ALTESC (1 << 1) /* Alt + Escape */
  155. #define CONSOLE_ALTSPACE (1 << 2) /* Alt + Space */
  156. #define CONSOLE_ALTENTER (1 << 3) /* Alt + Enter */
  157. #define CONSOLE_ALTPRTSC (1 << 4) /* Alt Print screen */
  158. #define CONSOLE_PRTSC (1 << 5) /* Print screen */
  159. #define CONSOLE_CTRLESC (1 << 6) /* Ctrl + Escape */
  160. typedef struct _APPKEY {
  161. WORD Modifier;
  162. WORD ScanCode;
  163. } APPKEY, *LPAPPKEY;
  164. #define CONSOLE_MODIFIER_SHIFT 0x0003 // Left shift key
  165. #define CONSOLE_MODIFIER_CONTROL 0x0004 // Either Control shift key
  166. #define CONSOLE_MODIFIER_ALT 0x0008 // Either Alt shift key
  167. BOOL
  168. APIENTRY
  169. SetConsoleKeyShortcuts(
  170. IN BOOL bSet,
  171. IN BYTE bReserveKeys,
  172. IN LPAPPKEY lpAppKeys,
  173. IN DWORD dwNumAppKeys
  174. );
  175. BOOL
  176. APIENTRY
  177. SetConsoleMenuClose(
  178. IN BOOL bEnable
  179. );
  180. DWORD
  181. GetConsoleInputExeName%(
  182. IN DWORD nBufferLength,
  183. OUT LPTSTR% lpBuffer
  184. );
  185. BOOL
  186. SetConsoleInputExeName%(
  187. IN LPTSTR% lpExeName
  188. );
  189. typedef struct _CONSOLE_READCONSOLE_CONTROL {
  190. IN ULONG nLength; // sizeof( CONSOLE_READCONSOLE_CONTROL )
  191. IN ULONG nInitialChars;
  192. IN ULONG dwCtrlWakeupMask;
  193. OUT ULONG dwControlKeyState;
  194. } CONSOLE_READCONSOLE_CONTROL, *PCONSOLE_READCONSOLE_CONTROL;
  195. #define CONSOLE_ADD_SUBST 1
  196. #define CONSOLE_REMOVE_SUBST 2
  197. #define CONSOLE_QUERY_SUBST 3
  198. BOOL
  199. ConsoleSubst(
  200. IN DWORD dwDriveNumber,
  201. IN DWORD dwFlag,
  202. IN OUT LPWSTR lpPhysicalDriveBuffer,
  203. IN DWORD dwPhysicalDriveBufferLength
  204. );
  205. #define CONSOLE_READ_NOREMOVE 0x0001
  206. #define CONSOLE_READ_NOWAIT 0x0002
  207. #define CONSOLE_READ_VALID (CONSOLE_READ_NOREMOVE | CONSOLE_READ_NOWAIT)
  208. BOOL
  209. WINAPI
  210. ReadConsoleInputEx%(
  211. HANDLE hConsoleInput,
  212. PINPUT_RECORD lpBuffer,
  213. DWORD nLength,
  214. LPDWORD lpNumberOfEventsRead,
  215. USHORT wFlags
  216. );
  217. BOOL
  218. WINAPI
  219. WriteConsoleInputVDM%(
  220. HANDLE hConsoleInput,
  221. PINPUT_RECORD lpBuffer,
  222. DWORD nLength,
  223. LPDWORD lpNumberOfEventsWritten
  224. );
  225. #if defined(FE_SB)
  226. BOOL
  227. APIENTRY
  228. GetConsoleNlsMode(
  229. IN HANDLE hConsole,
  230. OUT PDWORD lpdwNlsMode
  231. );
  232. BOOL
  233. APIENTRY
  234. SetConsoleNlsMode(
  235. IN HANDLE hConsole,
  236. IN DWORD fdwNlsMode
  237. );
  238. BOOL
  239. APIENTRY
  240. GetConsoleCharType(
  241. IN HANDLE hConsole,
  242. IN COORD coordCheck,
  243. OUT PDWORD pdwType
  244. );
  245. #define CHAR_TYPE_SBCS 0 // Displayed SBCS character
  246. #define CHAR_TYPE_LEADING 2 // Displayed leading byte of DBCS
  247. #define CHAR_TYPE_TRAILING 3 // Displayed trailing byte of DBCS
  248. BOOL
  249. APIENTRY
  250. SetConsoleLocalEUDC(
  251. IN HANDLE hConsoleHandle,
  252. IN WORD wCodePoint,
  253. IN COORD cFontSize,
  254. IN PCHAR lpSB
  255. );
  256. BOOL
  257. APIENTRY
  258. SetConsoleCursorMode(
  259. IN HANDLE hConsoleHandle,
  260. IN BOOL Blink,
  261. IN BOOL DBEnable
  262. );
  263. BOOL
  264. APIENTRY
  265. GetConsoleCursorMode(
  266. IN HANDLE hConsoleHandle,
  267. OUT PBOOL pbBlink,
  268. OUT PBOOL pbDBEnable
  269. );
  270. BOOL
  271. APIENTRY
  272. RegisterConsoleOS2(
  273. IN BOOL fOs2Register
  274. );
  275. BOOL
  276. APIENTRY
  277. SetConsoleOS2OemFormat(
  278. IN BOOL fOs2OemFormat
  279. );
  280. BOOL
  281. IsConsoleFullWidth(
  282. IN HDC hDC,
  283. IN DWORD CodePage,
  284. IN WCHAR wch
  285. );
  286. #if defined(FE_IME)
  287. BOOL
  288. APIENTRY
  289. RegisterConsoleIME(
  290. IN HWND hWndConsoleIME,
  291. OUT DWORD *dwConsoleThreadId
  292. );
  293. BOOL
  294. APIENTRY
  295. UnregisterConsoleIME(
  296. );
  297. #endif // FE_IME
  298. #endif // FE_SB