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.

341 lines
8.7 KiB

  1. /****************************************************************************
  2. * *
  3. * winuserk.h -- New private kernel-mode APIs *
  4. * *
  5. * Copyright (c) 1985 - 1999, Microsoft Corporation *
  6. * *
  7. ****************************************************************************/
  8. #ifndef _WINUSERK_
  9. #define _WINUSERK_
  10. #include "w32w64.h"
  11. //
  12. // Define API decoration for direct importing of DLL references.
  13. //
  14. #if !defined(_USER32_)
  15. #define WINUSERAPI DECLSPEC_IMPORT
  16. #else
  17. #define WINUSERAPI
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif /* __cplusplus */
  22. typedef struct tagDESKTOP * KPTR_MODIFIER PDESKTOP;
  23. typedef enum _CONSOLECONTROL {
  24. ConsoleDesktopConsoleThread, // 0
  25. ConsoleClassAtom, // 1
  26. ConsolePermanentFont, // 2
  27. ConsoleSetVDMCursorBounds, // 3
  28. ConsoleNotifyConsoleApplication, // 4
  29. ConsolePublicPalette, // 5
  30. ConsoleWindowStationProcess, // 6
  31. ConsoleRegisterConsoleIME, // 7
  32. ConsoleFullscreenSwitch, // 8
  33. ConsoleSetCaretInfo // 9
  34. } CONSOLECONTROL;
  35. /*
  36. * Hard error functions
  37. */
  38. #define HEF_NORMAL 0 /* normal FIFO error processing */
  39. #define HEF_SWITCH 1 /* desktop switch occured */
  40. #define HEF_RESTART 2 /* hard error was reordered, restart processing */
  41. typedef struct _CONSOLEDESKTOPCONSOLETHREAD {
  42. HDESK hdesk;
  43. DWORD dwThreadId;
  44. } CONSOLEDESKTOPCONSOLETHREAD, *PCONSOLEDESKTOPCONSOLETHREAD;
  45. typedef struct _CONSOLEWINDOWSTATIONPROCESS {
  46. DWORD dwProcessId;
  47. HWINSTA hwinsta;
  48. } CONSOLEWINDOWSTATIONPROCESS, *PCONSOLEWINDOWSTATIONPROCESS;
  49. #if defined(FE_IME)
  50. enum {REGCONIME_QUERY, REGCONIME_REGISTER, REGCONIME_UNREGISTER, REGCONIME_TERMINATE};
  51. typedef struct _CONSOLE_REGISTER_CONSOLEIME {
  52. IN HDESK hdesk;
  53. IN DWORD dwThreadId;
  54. IN DWORD dwAction; // is REGCONIME_QUERY/REGISTER/UNREGISTER/TERMINATE
  55. OUT DWORD dwConsoleInputThreadId;
  56. } CONSOLE_REGISTER_CONSOLEIME, *PCONSOLE_REGISTER_CONSOLEIME;
  57. #endif
  58. typedef struct _CONSOLE_FULLSCREEN_SWITCH {
  59. IN BOOL bFullscreenSwitch;
  60. IN HWND hwnd;
  61. IN PDEVMODEW pNewMode;
  62. } CONSOLE_FULLSCREEN_SWITCH, *PCONSOLE_FULLSCREEN_SWITCH;
  63. /*
  64. * Bug 273518 - joejo
  65. *
  66. * Adding optimization to bug fix
  67. */
  68. #define CPI_NEWPROCESSWINDOW 0x0001
  69. typedef struct _CONSOLE_PROCESS_INFO {
  70. IN DWORD dwProcessID;
  71. IN DWORD dwFlags;
  72. } CONSOLE_PROCESS_INFO, *PCONSOLE_PROCESS_INFO;
  73. typedef struct _CONSOLE_CARET_INFO {
  74. IN HWND hwnd;
  75. IN RECT rc;
  76. } CONSOLE_CARET_INFO, *PCONSOLE_CARET_INFO;
  77. NTSTATUS
  78. NtUserConsoleControl(
  79. IN CONSOLECONTROL Command,
  80. IN OUT PVOID ConsoleInformation,
  81. IN ULONG ConsoleInformationLength
  82. );
  83. HDESK
  84. NtUserResolveDesktop(
  85. IN HANDLE hProcess,
  86. IN PUNICODE_STRING pstrDesktop,
  87. IN BOOL fInherit,
  88. OUT HWINSTA *phwinsta
  89. );
  90. WINUSERAPI
  91. BOOL
  92. NtUserNotifyProcessCreate(
  93. IN DWORD dwProcessId,
  94. IN DWORD dwParentThreadId,
  95. IN ULONG_PTR dwData,
  96. IN DWORD dwFlags
  97. );
  98. typedef enum _HARDERRORCONTROL {
  99. HardErrorSetup,
  100. HardErrorCleanup,
  101. HardErrorAttach,
  102. HardErrorAttachUser,
  103. HardErrorDetach,
  104. HardErrorAttachNoQueue,
  105. HardErrorDetachNoQueue,
  106. HardErrorQuery,
  107. HardErrorInDefDesktop,
  108. #ifdef PRERELEASE
  109. HardErrorCheckOnDesktop
  110. #endif
  111. } HARDERRORCONTROL;
  112. /*
  113. * This structure is used to pass a handle and a pointer back
  114. * for later restoration when setting a CSRSS thread to a desktop.
  115. */
  116. typedef struct tagDESKRESTOREDATA {
  117. PDESKTOP pdeskRestore;
  118. HDESK hdeskNew; /*
  119. * This handle is opened to guarantee
  120. * that the desktop stays around and
  121. * active while the CSRSS thread is
  122. * using it.
  123. */
  124. } DESKRESTOREDATA, *PDESKRESTOREDATA;
  125. UINT
  126. NtUserHardErrorControl(
  127. IN HARDERRORCONTROL dwCmd,
  128. IN HANDLE handle OPTIONAL,
  129. OUT PDESKRESTOREDATA pdrdRestore OPTIONAL
  130. );
  131. #define HEC_SUCCESS 0
  132. #define HEC_ERROR 1
  133. #define HEC_WRONGDESKTOP 2
  134. #define HEC_DESKTOPSWITCH 3
  135. typedef enum _USERTHREADINFOCLASS {
  136. UserThreadShutdownInformation,
  137. UserThreadFlags,
  138. UserThreadTaskName,
  139. UserThreadWOWInformation,
  140. UserThreadHungStatus,
  141. UserThreadInitiateShutdown,
  142. UserThreadEndShutdown,
  143. UserThreadUseDesktop,
  144. UserThreadPolled, // obsolete
  145. UserThreadKeyboardState, // obsolete
  146. UserThreadCsrApiPort,
  147. UserThreadResyncKeyState, // obsolete
  148. UserThreadUseActiveDesktop
  149. } USERTHREADINFOCLASS;
  150. typedef enum _USERPROCESSINFOCLASS {
  151. UserProcessFlags
  152. } USERPROCESSINFOCLASS;
  153. #define USER_THREAD_GUI 1
  154. typedef struct _USERTHREAD_SHUTDOWN_INFORMATION {
  155. HWND hwndDesktop;
  156. NTSTATUS StatusShutdown;
  157. DWORD dwFlags;
  158. DESKRESTOREDATA drdRestore; /* Must be the last field or will be zero'ed */
  159. } USERTHREAD_SHUTDOWN_INFORMATION, *PUSERTHREAD_SHUTDOWN_INFORMATION;
  160. typedef struct _USERTHREAD_FLAGS {
  161. DWORD dwFlags;
  162. DWORD dwMask;
  163. } USERTHREAD_FLAGS, *PUSERTHREAD_FLAGS;
  164. typedef struct _USERTHREAD_USEDESKTOPINFO {
  165. HANDLE hThread;
  166. DESKRESTOREDATA drdRestore;
  167. } USERTHREAD_USEDESKTOPINFO, *PUSERTHREAD_USEDESKTOPINFO;
  168. typedef USERTHREAD_FLAGS USERPROCESS_FLAGS;
  169. typedef USERTHREAD_FLAGS *PUSERPROCESS_FLAGS;
  170. typedef struct _USERTHREAD_WOW_INFORMATION {
  171. PVOID lpfnWowExitTask;
  172. DWORD hTaskWow;
  173. } USERTHREAD_WOW_INFORMATION, *PUSERTHREAD_WOW_INFORMATION;
  174. WINUSERAPI
  175. NTSTATUS
  176. NtUserQueryInformationThread(
  177. IN HANDLE hThread,
  178. IN USERTHREADINFOCLASS ThreadInfoClass,
  179. OUT PVOID ThreadInformation,
  180. IN ULONG ThreadInformationLength,
  181. OUT PULONG ReturnLength OPTIONAL
  182. );
  183. NTSTATUS
  184. NtUserSetInformationThread(
  185. IN HANDLE hThread,
  186. IN USERTHREADINFOCLASS ThreadInfoClass,
  187. IN PVOID ThreadInformation,
  188. IN ULONG ThreadInformationLength
  189. );
  190. NTSTATUS
  191. NtUserSetInformationProcess(
  192. IN HANDLE hProcess,
  193. IN USERPROCESSINFOCLASS ProcessInfoClass,
  194. IN PVOID ProcessInformation,
  195. IN ULONG ProcessInformationLength
  196. );
  197. WINUSERAPI
  198. NTSTATUS
  199. NtUserSoundSentry(
  200. VOID
  201. );
  202. WINUSERAPI
  203. NTSTATUS
  204. NtUserTestForInteractiveUser(
  205. IN PLUID pluidCaller
  206. );
  207. WINUSERAPI
  208. NTSTATUS
  209. NtUserInitialize(
  210. IN DWORD dwVersion,
  211. IN HANDLE hPowerRequestEvent,
  212. IN HANDLE hMediaChangeEvent);
  213. WINUSERAPI
  214. NTSTATUS
  215. NtUserProcessConnect(
  216. IN HANDLE hProcess,
  217. IN OUT PVOID pConnectInfo,
  218. IN ULONG cbConnectInfo
  219. );
  220. HPALETTE
  221. NtUserSelectPalette(
  222. IN HDC hdc,
  223. IN HPALETTE hpalette,
  224. IN BOOL fForceBackground
  225. );
  226. typedef enum _WINDOWINFOCLASS {
  227. WindowProcess,
  228. WindowThread,
  229. WindowActiveWindow,
  230. WindowFocusWindow,
  231. WindowIsHung,
  232. WindowClientBase,
  233. WindowIsForegroundThread,
  234. WindowDefaultImeWindow,
  235. WindowDefaultInputContext,
  236. } WINDOWINFOCLASS;
  237. HANDLE
  238. NtUserQueryWindow(
  239. IN HWND hwnd,
  240. IN WINDOWINFOCLASS WindowInformation
  241. );
  242. typedef enum _USERTHREADSTATECLASS {
  243. UserThreadStateFocusWindow,
  244. UserThreadStateActiveWindow,
  245. UserThreadStateCaptureWindow,
  246. UserThreadStateDefaultImeWindow,
  247. UserThreadStateDefaultInputContext,
  248. UserThreadStateInputState,
  249. UserThreadStateCursor,
  250. UserThreadStateChangeBits,
  251. UserThreadStatePeekMessage,
  252. UserThreadStateExtraInfo,
  253. UserThreadStateInSendMessage,
  254. UserThreadStateMessageTime,
  255. UserThreadStateIsForeground,
  256. // #if defined(FE_IME)
  257. UserThreadStateImeCompatFlags,
  258. UserThreadStatePreviousKeyboardLayout,
  259. UserThreadStateIsWinlogonThread,
  260. UserThreadStateNeedsSecurity,
  261. // #endif
  262. UserThreadStateIsConImeThread,
  263. UserThreadConnect,
  264. } USERTHREADSTATECLASS;
  265. ULONG_PTR
  266. NtUserGetThreadState(
  267. IN USERTHREADSTATECLASS ThreadState);
  268. NTSTATUS
  269. NtUserEnumDisplaySettings(
  270. IN PUNICODE_STRING pstrDeviceName,
  271. IN DWORD iModeNum,
  272. OUT LPDEVMODEW lpDevMode,
  273. IN DWORD dwFlags);
  274. #if defined(FE_IME)
  275. BOOL
  276. NtUserGetObjectInformation(
  277. IN HANDLE hObject,
  278. IN int nIndex,
  279. OUT PVOID pvInfo,
  280. IN DWORD nLength,
  281. IN LPDWORD pnLengthNeeded);
  282. #endif // FE_IME
  283. #ifdef __cplusplus
  284. }
  285. #endif /* __cplusplus */
  286. #endif /* !_WINUSERK_ */