4 #pragma GCC system_header
11 #if (_WIN32_WINNT >= 0x0501)
12 // session notification message
13 #define WM_WTSSESSION_CHANGE 0x02B1
15 typedef enum _WTS_INFO_CLASS
{
16 WTSInitialProgram
= 0,
17 WTSApplicationName
= 1,
18 WTSWorkingDirectory
= 2,
22 WTSWinStationName
= 6,
25 WTSClientBuildNumber
= 9,
27 WTSClientDirectory
= 11,
28 WTSClientProductId
= 12,
29 WTSClientHardwareId
= 13,
30 WTSClientAddress
= 14,
31 WTSClientDisplay
= 15,
32 WTSClientProtocolType
= 16,
35 WTSIncomingBytes
= 19,
36 WTSOutgoingBytes
= 20,
37 WTSIncomingFrames
= 21,
38 WTSOutgoingFrames
= 22,
43 typedef enum _WTS_CONNECTSTATE_CLASS
{
54 } WTS_CONNECTSTATE_CLASS
;
56 // session notification message flags
57 #define WTS_CONSOLE_CONNECT 0x1
58 #define WTS_CONSOLE_DISCONNECT 0x2
59 #define WTS_REMOTE_CONNECT 0x3
60 #define WTS_REMOTE_DISCONNECT 0x4
61 #define WTS_SESSION_LOGON 0x5
62 #define WTS_SESSION_LOGOFF 0x6
63 #define WTS_SESSION_LOCK 0x7
64 #define WTS_SESSION_UNLOCK 0x8
65 #define WTS_SESSION_REMOTE_CONTROL 0x9
67 // WTSRegisterSessionNotifiction flags
68 #define NOTIFY_FOR_THIS_SESSION 0
69 #define NOTIFY_FOR_ALL_SESSIONS 1
71 BOOL WINAPI
WTSRegisterSessionNotification(HWND hWnd
, DWORD dwFlags
);
72 BOOL WINAPI
WTSUnRegisterSessionNotification(HWND hWnd
);
73 BOOL WINAPI
WTSQuerySessionInformationA(HANDLE hServer
, DWORD SessionId
, WTS_INFO_CLASS WTSInfoClass
,
74 LPSTR
*ppBuffer
, DWORD
*pBytesReturned
);
75 BOOL WINAPI
WTSQuerySessionInformationW(HANDLE hServer
, DWORD SessionId
, WTS_INFO_CLASS WTSInfoClass
,
76 LPTSTR
*ppBuffer
, DWORD
*pBytesReturned
);
77 void WINAPI
WTSFreeMemory(PVOID pMemory
);
80 #define WTSQuerySessionInformation WTSQuerySessionInformationW
82 #define WTSQuerySessionInformation WTSQuerySessionInformationA
85 #endif /* _WIN32_WINNT >= 0x0501 */
87 #if (_WIN32_WINNT >= 0x0500)
89 // WTSWaitSystemEvent local server handle
90 #define WTS_CURRENT_SERVER_HANDLE 0
91 #define WTS_CURRENT_SESSION 0
93 // WTSWaitSystemEvent flags
94 #define WTS_EVENT_NONE 0x00000000
95 #define WTS_EVENT_CREATE 0x00000001
96 #define WTS_EVENT_DELETE 0x00000002
97 #define WTS_EVENT_RENAME 0x00000004
98 #define WTS_EVENT_CONNECT 0x00000008
99 #define WTS_EVENT_DISCONNECT 0x00000010
100 #define WTS_EVENT_LOGON 0x00000020
101 #define WTS_EVENT_LOGOFF 0x00000040
102 #define WTS_EVENT_STATECHANGE 0x00000080
103 #define WTS_EVENT_LICENSE 0x00000100
104 #define WTS_EVENT_ALL 0x7FFFFFFF
105 #define WTS_EVENT_FLUSH 0x80000000
107 BOOL WINAPI
WTSWaitSystemEvent(HANDLE hServer
, DWORD EventMask
, DWORD
* pEventFlags
);
108 BOOL WINAPI
WTSDisconnectSession(HANDLE hServer
, DWORD SessionId
, BOOL bWait
);
109 #endif /* _WIN32_WINNT >= 0x0500 */
115 #endif /* _WTSAPI32_H */