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.

732 lines
20 KiB

  1. /*********************************************************************
  2. *
  3. * WTSAPI32.H
  4. *
  5. * Windows Terminal Server public APIs
  6. *
  7. * Copyright 1995-1999, Citrix Systems Inc.
  8. * Copyright (c) 1997-1999 Microsoft Corporation
  9. *
  10. **********************************************************************/
  11. #ifndef _INC_WTSAPI
  12. #define _INC_WTSAPI
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /*===================================================================
  20. == Defines
  21. =====================================================================*/
  22. /*
  23. * Specifies the current server
  24. */
  25. #define WTS_CURRENT_SERVER ((HANDLE)NULL)
  26. #define WTS_CURRENT_SERVER_HANDLE ((HANDLE)NULL)
  27. #define WTS_CURRENT_SERVER_NAME (NULL)
  28. /*
  29. * Specifies the current session (SessionId)
  30. */
  31. #define WTS_CURRENT_SESSION ((DWORD)-1)
  32. /*
  33. * Possible pResponse values from WTSSendMessage()
  34. */
  35. #ifndef IDTIMEOUT
  36. #define IDTIMEOUT 32000
  37. #endif
  38. #ifndef IDASYNC
  39. #define IDASYNC 32001
  40. #endif
  41. /*
  42. * Shutdown flags
  43. */
  44. #define WTS_WSD_LOGOFF 0x00000001 // log off all users except
  45. // current user; deletes
  46. // WinStations (a reboot is
  47. // required to recreate the
  48. // WinStations)
  49. #define WTS_WSD_SHUTDOWN 0x00000002 // shutdown system
  50. #define WTS_WSD_REBOOT 0x00000004 // shutdown and reboot
  51. #define WTS_WSD_POWEROFF 0x00000008 // shutdown and power off (on
  52. // machines that support power
  53. // off through software)
  54. #define WTS_WSD_FASTREBOOT 0x00000010 // reboot without logging users
  55. // off or shutting down
  56. /*===================================================================
  57. == WTS_CONNECTSTATE_CLASS - Session connect state
  58. =====================================================================*/
  59. typedef enum _WTS_CONNECTSTATE_CLASS {
  60. WTSActive, // User logged on to WinStation
  61. WTSConnected, // WinStation connected to client
  62. WTSConnectQuery, // In the process of connecting to client
  63. WTSShadow, // Shadowing another WinStation
  64. WTSDisconnected, // WinStation logged on without client
  65. WTSIdle, // Waiting for client to connect
  66. WTSListen, // WinStation is listening for connection
  67. WTSReset, // WinStation is being reset
  68. WTSDown, // WinStation is down due to error
  69. WTSInit, // WinStation in initialization
  70. } WTS_CONNECTSTATE_CLASS;
  71. /*=====================================================================
  72. == WTS_SERVER_INFO - returned by WTSEnumerateServers (version 1)
  73. =====================================================================*/
  74. /*
  75. * WTSEnumerateServers() returns two variables: pServerInfo and Count.
  76. * The latter is the number of WTS_SERVER_INFO structures contained in
  77. * the former. In order to read each server, iterate i from 0 to
  78. * Count-1 and reference the server name as
  79. * pServerInfo[i].pServerName; for example:
  80. *
  81. * for ( i=0; i < Count; i++ ) {
  82. * _tprintf( TEXT("%s "), pServerInfo[i].pServerName );
  83. * }
  84. *
  85. * The memory returned looks like the following. P is a pServerInfo
  86. * pointer, and D is the string data for that pServerInfo:
  87. *
  88. * P1 P2 P3 P4 ... Pn D1 D2 D3 D4 ... Dn
  89. *
  90. * This makes it easier to iterate the servers, using code similar to
  91. * the above.
  92. */
  93. typedef struct _WTS_SERVER_INFOW {
  94. LPWSTR pServerName; // server name
  95. } WTS_SERVER_INFOW, * PWTS_SERVER_INFOW;
  96. typedef struct _WTS_SERVER_INFOA {
  97. LPSTR pServerName; // server name
  98. } WTS_SERVER_INFOA, * PWTS_SERVER_INFOA;
  99. #ifdef UNICODE
  100. #define WTS_SERVER_INFO WTS_SERVER_INFOW
  101. #define PWTS_SERVER_INFO PWTS_SERVER_INFOW
  102. #else
  103. #define WTS_SERVER_INFO WTS_SERVER_INFOA
  104. #define PWTS_SERVER_INFO PWTS_SERVER_INFOA
  105. #endif
  106. /*=====================================================================
  107. == WTS_SESSION_INFO - returned by WTSEnumerateSessions (version 1)
  108. =====================================================================*/
  109. /*
  110. * WTSEnumerateSessions() returns data in a similar format to the above
  111. * WTSEnumerateServers(). It returns two variables: pSessionInfo and
  112. * Count. The latter is the number of WTS_SESSION_INFO structures
  113. * contained in the former. Iteration is similar, except that there
  114. * are three parts to each entry, so it would look like this:
  115. *
  116. * for ( i=0; i < Count; i++ ) {
  117. * _tprintf( TEXT("%-5u %-20s %u\n"),
  118. pSessionInfo[i].SessionId,
  119. * pSessionInfo[i].pWinStationName,
  120. * pSessionInfo[i].State );
  121. * }
  122. *
  123. * The memory returned is also segmented as the above, with all the
  124. * structures allocated at the start and the string data at the end.
  125. * We'll use S for the SessionId, P for the pWinStationName pointer
  126. * and D for the string data, and C for the connect State:
  127. *
  128. * S1 P1 C1 S2 P2 C2 S3 P3 C3 S4 P4 C4 ... Sn Pn Cn D1 D2 D3 D4 ... Dn
  129. *
  130. * As above, this makes it easier to iterate the sessions.
  131. */
  132. typedef struct _WTS_SESSION_INFOW {
  133. DWORD SessionId; // session id
  134. LPWSTR pWinStationName; // name of WinStation this session is
  135. // connected to
  136. WTS_CONNECTSTATE_CLASS State; // connection state (see enum)
  137. } WTS_SESSION_INFOW, * PWTS_SESSION_INFOW;
  138. typedef struct _WTS_SESSION_INFOA {
  139. DWORD SessionId; // session id
  140. LPSTR pWinStationName; // name of WinStation this session is
  141. // connected to
  142. WTS_CONNECTSTATE_CLASS State; // connection state (see enum)
  143. } WTS_SESSION_INFOA, * PWTS_SESSION_INFOA;
  144. #ifdef UNICODE
  145. #define WTS_SESSION_INFO WTS_SESSION_INFOW
  146. #define PWTS_SESSION_INFO PWTS_SESSION_INFOW
  147. #else
  148. #define WTS_SESSION_INFO WTS_SESSION_INFOA
  149. #define PWTS_SESSION_INFO PWTS_SESSION_INFOA
  150. #endif
  151. /*=====================================================================
  152. == WTS_PROCESS_INFO - returned by WTSEnumerateProcesses (version 1)
  153. =====================================================================*/
  154. /*
  155. * WTSEnumerateProcesses() also returns data similar to
  156. * WTSEnumerateServers(). It returns two variables: pProcessInfo and
  157. * Count. The latter is the number of WTS_PROCESS_INFO structures
  158. * contained in the former. Iteration is similar, except that there
  159. * are four parts to each entry, so it would look like this:
  160. *
  161. * for ( i=0; i < Count; i++ ) {
  162. * GetUserNameFromSid( pProcessInfo[i].pUserSid, UserName,
  163. * sizeof(UserName) );
  164. * _tprintf( TEXT("%-5u %-20s %-5u %s\n"),
  165. * pProcessInfo[i].SessionId,
  166. * UserName,
  167. * pProcessInfo[i].ProcessId,
  168. * pProcessInfo[i].pProcessName );
  169. * }
  170. *
  171. * The memory returned is also segmented as the above, with all the
  172. * structures allocated at the start and the string data at the end.
  173. * We'll use S for the SessionId, R for the ProcessId, P for the
  174. * pProcessName pointer and D for the string data, and U for pUserSid:
  175. *
  176. * S1 R1 P1 U1 S2 R2 P2 U2 S3 R3 P3 U3 ... Sn Rn Pn Un D1 D2 D3 ... Dn
  177. *
  178. * As above, this makes it easier to iterate the processes.
  179. */
  180. typedef struct _WTS_PROCESS_INFOW {
  181. DWORD SessionId; // session id
  182. DWORD ProcessId; // process id
  183. LPWSTR pProcessName; // name of process
  184. PSID pUserSid; // user's SID
  185. } WTS_PROCESS_INFOW, * PWTS_PROCESS_INFOW;
  186. typedef struct _WTS_PROCESS_INFOA {
  187. DWORD SessionId; // session id
  188. DWORD ProcessId; // process id
  189. LPSTR pProcessName; // name of process
  190. PSID pUserSid; // user's SID
  191. } WTS_PROCESS_INFOA, * PWTS_PROCESS_INFOA;
  192. #ifdef UNICODE
  193. #define WTS_PROCESS_INFO WTS_PROCESS_INFOW
  194. #define PWTS_PROCESS_INFO PWTS_PROCESS_INFOW
  195. #else
  196. #define WTS_PROCESS_INFO WTS_PROCESS_INFOA
  197. #define PWTS_PROCESS_INFO PWTS_PROCESS_INFOA
  198. #endif
  199. /*=====================================================================
  200. == WTS_INFO_CLASS - WTSQuerySessionInformation
  201. == (See additional typedefs for more info on structures)
  202. =====================================================================*/
  203. #define WTS_PROTOCOL_TYPE_CONSOLE 0 // Console
  204. #define WTS_PROTOCOL_TYPE_ICA 1 // ICA Protocol
  205. #define WTS_PROTOCOL_TYPE_RDP 2 // RDP Protocol
  206. typedef enum _WTS_INFO_CLASS {
  207. WTSInitialProgram,
  208. WTSApplicationName,
  209. WTSWorkingDirectory,
  210. WTSOEMId,
  211. WTSSessionId,
  212. WTSUserName,
  213. WTSWinStationName,
  214. WTSDomainName,
  215. WTSConnectState,
  216. WTSClientBuildNumber,
  217. WTSClientName,
  218. WTSClientDirectory,
  219. WTSClientProductId,
  220. WTSClientHardwareId,
  221. WTSClientAddress,
  222. WTSClientDisplay,
  223. WTSClientProtocolType,
  224. } WTS_INFO_CLASS;
  225. /*=====================================================================
  226. == WTSQuerySessionInformation - (WTSClientAddress)
  227. =====================================================================*/
  228. typedef struct _WTS_CLIENT_ADDRESS {
  229. DWORD AddressFamily; // AF_INET, AF_IPX, AF_NETBIOS, AF_UNSPEC
  230. BYTE Address[20]; // client network address
  231. } WTS_CLIENT_ADDRESS, * PWTS_CLIENT_ADDRESS;
  232. /*=====================================================================
  233. == WTSQuerySessionInformation - (WTSClientDisplay)
  234. =====================================================================*/
  235. typedef struct _WTS_CLIENT_DISPLAY {
  236. DWORD HorizontalResolution; // horizontal dimensions, in pixels
  237. DWORD VerticalResolution; // vertical dimensions, in pixels
  238. DWORD ColorDepth; // 1=16, 2=256, 4=64K, 8=16M
  239. } WTS_CLIENT_DISPLAY, * PWTS_CLIENT_DISPLAY;
  240. /*=====================================================================
  241. == WTS_CONFIG_CLASS - WTSQueryUserConfig/WTSSetUserConfig
  242. =====================================================================*/
  243. typedef enum _WTS_CONFIG_CLASS {
  244. //Initial program settings
  245. WTSUserConfigInitialProgram, // string returned/expected
  246. WTSUserConfigWorkingDirectory, // string returned/expected
  247. WTSUserConfigfInheritInitialProgram, // DWORD returned/expected
  248. //
  249. WTSUserConfigfAllowLogonTerminalServer, //DWORD returned/expected
  250. //Timeout settings
  251. WTSUserConfigTimeoutSettingsConnections, //DWORD returned/expected
  252. WTSUserConfigTimeoutSettingsDisconnections, //DWORD returned/expected
  253. WTSUserConfigTimeoutSettingsIdle, //DWORD returned/expected
  254. //Client device settings
  255. WTSUserConfigfDeviceClientDrives, //DWORD returned/expected
  256. WTSUserConfigfDeviceClientPrinters, //DWORD returned/expected
  257. WTSUserConfigfDeviceClientDefaultPrinter, //DWORD returned/expected
  258. //Connection settings
  259. WTSUserConfigBrokenTimeoutSettings, //DWORD returned/expected
  260. WTSUserConfigReconnectSettings, //DWORD returned/expected
  261. //Modem settings
  262. WTSUserConfigModemCallbackSettings, //DWORD returned/expected
  263. WTSUserConfigModemCallbackPhoneNumber, // string returned/expected
  264. //Shadow settings
  265. WTSUserConfigShadowingSettings, //DWORD returned/expected
  266. //User Profile settings
  267. WTSUserConfigTerminalServerProfilePath, // string returned/expected
  268. //Terminal Server home directory
  269. WTSUserConfigTerminalServerHomeDir, // string returned/expected
  270. WTSUserConfigTerminalServerHomeDirDrive, // string returned/expected
  271. WTSUserConfigfTerminalServerRemoteHomeDir, // DWORD 0:LOCAL 1:REMOTE
  272. } WTS_CONFIG_CLASS;
  273. /*=====================================================================
  274. == WTS_EVENT - Event flags for WTSWaitSystemEvent
  275. =====================================================================*/
  276. #define WTS_EVENT_NONE 0x00000000 // return no event
  277. #define WTS_EVENT_CREATE 0x00000001 // new WinStation created
  278. #define WTS_EVENT_DELETE 0x00000002 // existing WinStation deleted
  279. #define WTS_EVENT_RENAME 0x00000004 // existing WinStation renamed
  280. #define WTS_EVENT_CONNECT 0x00000008 // WinStation connect to client
  281. #define WTS_EVENT_DISCONNECT 0x00000010 // WinStation logged on without
  282. // client
  283. #define WTS_EVENT_LOGON 0x00000020 // user logged on to existing
  284. // WinStation
  285. #define WTS_EVENT_LOGOFF 0x00000040 // user logged off from
  286. // existing WinStation
  287. #define WTS_EVENT_STATECHANGE 0x00000080 // WinStation state change
  288. #define WTS_EVENT_LICENSE 0x00000100 // license state change
  289. #define WTS_EVENT_ALL 0x7fffffff // wait for all event types
  290. #define WTS_EVENT_FLUSH 0x80000000 // unblock all waiters
  291. /*=====================================================================
  292. == WTS_VIRTUAL_CLASS - WTSVirtualChannelQuery
  293. =====================================================================*/
  294. typedef enum _WTS_VIRTUAL_CLASS {
  295. WTSVirtualClientData, // Virtual channel client module data
  296. // (C2H data)
  297. WTSVirtualFileHandle
  298. } WTS_VIRTUAL_CLASS;
  299. /*=====================================================================
  300. == Windows Terminal Server public APIs
  301. =====================================================================*/
  302. BOOL
  303. WINAPI
  304. WTSEnumerateServersW(
  305. IN LPWSTR pDomainName,
  306. IN DWORD Reserved,
  307. IN DWORD Version,
  308. OUT PWTS_SERVER_INFOW * ppServerInfo,
  309. OUT DWORD * pCount
  310. );
  311. BOOL
  312. WINAPI
  313. WTSEnumerateServersA(
  314. IN LPSTR pDomainName,
  315. IN DWORD Reserved,
  316. IN DWORD Version,
  317. OUT PWTS_SERVER_INFOA * ppServerInfo,
  318. OUT DWORD * pCount
  319. );
  320. #ifdef UNICODE
  321. #define WTSEnumerateServers WTSEnumerateServersW
  322. #else
  323. #define WTSEnumerateServers WTSEnumerateServersA
  324. #endif
  325. /*------------------------------------------------*/
  326. HANDLE
  327. WINAPI
  328. WTSOpenServerW(
  329. IN LPWSTR pServerName
  330. );
  331. HANDLE
  332. WINAPI
  333. WTSOpenServerA(
  334. IN LPSTR pServerName
  335. );
  336. #ifdef UNICODE
  337. #define WTSOpenServer WTSOpenServerW
  338. #else
  339. #define WTSOpenServer WTSOpenServerA
  340. #endif
  341. /*------------------------------------------------*/
  342. VOID
  343. WINAPI
  344. WTSCloseServer(
  345. IN HANDLE hServer
  346. );
  347. /*------------------------------------------------*/
  348. BOOL
  349. WINAPI
  350. WTSEnumerateSessionsW(
  351. IN HANDLE hServer,
  352. IN DWORD Reserved,
  353. IN DWORD Version,
  354. OUT PWTS_SESSION_INFOW * ppSessionInfo,
  355. OUT DWORD * pCount
  356. );
  357. BOOL
  358. WINAPI
  359. WTSEnumerateSessionsA(
  360. IN HANDLE hServer,
  361. IN DWORD Reserved,
  362. IN DWORD Version,
  363. OUT PWTS_SESSION_INFOA * ppSessionInfo,
  364. OUT DWORD * pCount
  365. );
  366. #ifdef UNICODE
  367. #define WTSEnumerateSessions WTSEnumerateSessionsW
  368. #else
  369. #define WTSEnumerateSessions WTSEnumerateSessionsA
  370. #endif
  371. /*------------------------------------------------*/
  372. BOOL
  373. WINAPI
  374. WTSEnumerateProcessesW(
  375. IN HANDLE hServer,
  376. IN DWORD Reserved,
  377. IN DWORD Version,
  378. OUT PWTS_PROCESS_INFOW * ppProcessInfo,
  379. OUT DWORD * pCount
  380. );
  381. BOOL
  382. WINAPI
  383. WTSEnumerateProcessesA(
  384. IN HANDLE hServer,
  385. IN DWORD Reserved,
  386. IN DWORD Version,
  387. OUT PWTS_PROCESS_INFOA * ppProcessInfo,
  388. OUT DWORD * pCount
  389. );
  390. #ifdef UNICODE
  391. #define WTSEnumerateProcesses WTSEnumerateProcessesW
  392. #else
  393. #define WTSEnumerateProcesses WTSEnumerateProcessesA
  394. #endif
  395. /*------------------------------------------------*/
  396. BOOL
  397. WINAPI
  398. WTSTerminateProcess(
  399. IN HANDLE hServer,
  400. IN DWORD ProcessId,
  401. IN DWORD ExitCode
  402. );
  403. /*------------------------------------------------*/
  404. BOOL
  405. WINAPI
  406. WTSQuerySessionInformationW(
  407. IN HANDLE hServer,
  408. IN DWORD SessionId,
  409. IN WTS_INFO_CLASS WTSInfoClass,
  410. OUT LPWSTR * ppBuffer,
  411. OUT DWORD * pBytesReturned
  412. );
  413. BOOL
  414. WINAPI
  415. WTSQuerySessionInformationA(
  416. IN HANDLE hServer,
  417. IN DWORD SessionId,
  418. IN WTS_INFO_CLASS WTSInfoClass,
  419. OUT LPSTR * ppBuffer,
  420. OUT DWORD * pBytesReturned
  421. );
  422. #ifdef UNICODE
  423. #define WTSQuerySessionInformation WTSQuerySessionInformationW
  424. #else
  425. #define WTSQuerySessionInformation WTSQuerySessionInformationA
  426. #endif
  427. /*------------------------------------------------*/
  428. BOOL
  429. WINAPI
  430. WTSQueryUserConfigW(
  431. IN LPWSTR pServerName,
  432. IN LPWSTR pUserName,
  433. IN WTS_CONFIG_CLASS WTSConfigClass,
  434. OUT LPWSTR * ppBuffer,
  435. OUT DWORD * pBytesReturned
  436. );
  437. BOOL
  438. WINAPI
  439. WTSQueryUserConfigA(
  440. IN LPSTR pServerName,
  441. IN LPSTR pUserName,
  442. IN WTS_CONFIG_CLASS WTSConfigClass,
  443. OUT LPSTR * ppBuffer,
  444. OUT DWORD * pBytesReturned
  445. );
  446. #ifdef UNICODE
  447. #define WTSQueryUserConfig WTSQueryUserConfigW
  448. #else
  449. #define WTSQueryUserConfig WTSQueryUserConfigA
  450. #endif
  451. /*------------------------------------------------*/
  452. BOOL
  453. WINAPI
  454. WTSSetUserConfigW(
  455. IN LPWSTR pServerName,
  456. IN LPWSTR pUserName,
  457. IN WTS_CONFIG_CLASS WTSConfigClass,
  458. IN LPWSTR pBuffer,
  459. IN DWORD DataLength
  460. );
  461. BOOL
  462. WINAPI
  463. WTSSetUserConfigA(
  464. IN LPSTR pServerName,
  465. IN LPSTR pUserName,
  466. IN WTS_CONFIG_CLASS WTSConfigClass,
  467. IN LPSTR pBuffer,
  468. IN DWORD DataLength
  469. );
  470. #ifdef UNICODE
  471. #define WTSSetUserConfig WTSSetUserConfigW
  472. #else
  473. #define WTSSetUserConfig WTSSetUserConfigA
  474. #endif
  475. /*------------------------------------------------*/
  476. BOOL
  477. WINAPI
  478. WTSSendMessageW(
  479. IN HANDLE hServer,
  480. IN DWORD SessionId,
  481. IN LPWSTR pTitle,
  482. IN DWORD TitleLength,
  483. IN LPWSTR pMessage,
  484. IN DWORD MessageLength,
  485. IN DWORD Style,
  486. IN DWORD Timeout,
  487. OUT DWORD * pResponse,
  488. IN BOOL bWait
  489. );
  490. BOOL
  491. WINAPI
  492. WTSSendMessageA(
  493. IN HANDLE hServer,
  494. IN DWORD SessionId,
  495. IN LPSTR pTitle,
  496. IN DWORD TitleLength,
  497. IN LPSTR pMessage,
  498. IN DWORD MessageLength,
  499. IN DWORD Style,
  500. IN DWORD Timeout,
  501. OUT DWORD * pResponse,
  502. IN BOOL bWait
  503. );
  504. #ifdef UNICODE
  505. #define WTSSendMessage WTSSendMessageW
  506. #else
  507. #define WTSSendMessage WTSSendMessageA
  508. #endif
  509. /*------------------------------------------------*/
  510. BOOL
  511. WINAPI
  512. WTSDisconnectSession(
  513. IN HANDLE hServer,
  514. IN DWORD SessionId,
  515. IN BOOL bWait
  516. );
  517. /*------------------------------------------------*/
  518. BOOL
  519. WINAPI
  520. WTSLogoffSession(
  521. IN HANDLE hServer,
  522. IN DWORD SessionId,
  523. IN BOOL bWait
  524. );
  525. /*------------------------------------------------*/
  526. BOOL
  527. WINAPI
  528. WTSShutdownSystem(
  529. IN HANDLE hServer,
  530. IN DWORD ShutdownFlag
  531. );
  532. /*------------------------------------------------*/
  533. BOOL
  534. WINAPI
  535. WTSWaitSystemEvent(
  536. IN HANDLE hServer,
  537. IN DWORD EventMask,
  538. OUT DWORD * pEventFlags
  539. );
  540. /*------------------------------------------------*/
  541. HANDLE
  542. WINAPI
  543. WTSVirtualChannelOpen(
  544. IN HANDLE hServer,
  545. IN DWORD SessionId,
  546. IN LPSTR pVirtualName /* ascii name */
  547. );
  548. BOOL
  549. WINAPI
  550. WTSVirtualChannelClose(
  551. IN HANDLE hChannelHandle
  552. );
  553. BOOL
  554. WINAPI
  555. WTSVirtualChannelRead(
  556. IN HANDLE hChannelHandle,
  557. IN ULONG TimeOut,
  558. OUT PCHAR Buffer,
  559. IN ULONG BufferSize,
  560. OUT PULONG pBytesRead
  561. );
  562. BOOL
  563. WINAPI
  564. WTSVirtualChannelWrite(
  565. IN HANDLE hChannelHandle,
  566. IN PCHAR Buffer,
  567. IN ULONG Length,
  568. OUT PULONG pBytesWritten
  569. );
  570. BOOL
  571. WINAPI
  572. WTSVirtualChannelPurgeInput(
  573. IN HANDLE hChannelHandle
  574. );
  575. BOOL
  576. WINAPI
  577. WTSVirtualChannelPurgeOutput(
  578. IN HANDLE hChannelHandle
  579. );
  580. BOOL
  581. WINAPI
  582. WTSVirtualChannelQuery(
  583. IN HANDLE hChannelHandle,
  584. IN WTS_VIRTUAL_CLASS,
  585. OUT PVOID *ppBuffer,
  586. OUT DWORD *pBytesReturned
  587. );
  588. /*------------------------------------------------*/
  589. VOID
  590. WINAPI
  591. WTSFreeMemory(
  592. IN PVOID pMemory
  593. );
  594. /* Flags for Console Notification */
  595. #define NOTIFY_FOR_ALL_SESSIONS 1
  596. #define NOTIFY_FOR_THIS_SESSION 0
  597. BOOL WINAPI
  598. WTSRegisterSessionNotification(
  599. HWND hWnd,
  600. DWORD dwFlags
  601. );
  602. BOOL WINAPI
  603. WTSUnRegisterSessionNotification(
  604. HWND hWnd
  605. );
  606. BOOL WINAPI
  607. WTSQueryUserToken(
  608. ULONG SessionId,
  609. PHANDLE phToken
  610. );
  611. #ifdef __cplusplus
  612. }
  613. #endif
  614. #endif /* !_INC_WTSAPI */