Welcome to mirror list, hosted at ThFree Co, Russian Federation.

wtsapi32.h « include « w32api « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: db2d24b38e01516a4b003eec5052a94407e34177 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#ifndef _WTSAPI32_H
#define _WTSAPI32_H
#if __GNUC__ >= 3
#pragma GCC system_header
#endif

#ifdef __cplusplus
extern "C" {
#endif

#if (_WIN32_WINNT >= 0x0501)
  // session notification message
#define WM_WTSSESSION_CHANGE		0x02B1

typedef enum _WTS_INFO_CLASS {
  WTSInitialProgram       = 0,
  WTSApplicationName      = 1,
  WTSWorkingDirectory     = 2,
  WTSOEMId                = 3,
  WTSSessionId            = 4,
  WTSUserName             = 5,
  WTSWinStationName       = 6,
  WTSDomainName           = 7,
  WTSConnectState         = 8,
  WTSClientBuildNumber    = 9,
  WTSClientName           = 10,
  WTSClientDirectory      = 11,
  WTSClientProductId      = 12,
  WTSClientHardwareId     = 13,
  WTSClientAddress        = 14,
  WTSClientDisplay        = 15,
  WTSClientProtocolType   = 16,
  WTSIdleTime             = 17,
  WTSLogonTime            = 18,
  WTSIncomingBytes        = 19,
  WTSOutgoingBytes        = 20,
  WTSIncomingFrames       = 21,
  WTSOutgoingFrames       = 22,
  WTSClientInfo           = 23,
  WTSSessionInfo          = 24
} WTS_INFO_CLASS;

typedef enum _WTS_CONNECTSTATE_CLASS {
  WTSActive,
  WTSConnected,
  WTSConnectQuery,
  WTSShadow,
  WTSDisconnected,
  WTSIdle,
  WTSListen,
  WTSReset,
  WTSDown,
  WTSInit 
} WTS_CONNECTSTATE_CLASS;

  // session notification message flags
#define WTS_CONSOLE_CONNECT			0x1
#define WTS_CONSOLE_DISCONNECT		0x2
#define WTS_REMOTE_CONNECT			0x3
#define WTS_REMOTE_DISCONNECT		0x4
#define WTS_SESSION_LOGON			0x5
#define WTS_SESSION_LOGOFF			0x6
#define WTS_SESSION_LOCK			0x7
#define WTS_SESSION_UNLOCK			0x8
#define WTS_SESSION_REMOTE_CONTROL	0x9

  // WTSRegisterSessionNotifiction flags
#define NOTIFY_FOR_THIS_SESSION		0
#define NOTIFY_FOR_ALL_SESSIONS		1

BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags);
BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd);
BOOL WINAPI WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass,
                                LPSTR *ppBuffer, DWORD *pBytesReturned);
BOOL WINAPI WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass,
                                LPTSTR *ppBuffer, DWORD *pBytesReturned);
void WINAPI WTSFreeMemory(PVOID pMemory);

#ifdef UNICODE
#define WTSQuerySessionInformation WTSQuerySessionInformationW
#else
#define WTSQuerySessionInformation WTSQuerySessionInformationA
#endif

#endif /* _WIN32_WINNT >= 0x0501 */

#if (_WIN32_WINNT >= 0x0500)

  // WTSWaitSystemEvent local server handle
#define WTS_CURRENT_SERVER_HANDLE 0
#define WTS_CURRENT_SESSION       0

  // WTSWaitSystemEvent flags
#define WTS_EVENT_NONE				0x00000000
#define WTS_EVENT_CREATE			0x00000001
#define WTS_EVENT_DELETE			0x00000002
#define WTS_EVENT_RENAME			0x00000004
#define WTS_EVENT_CONNECT			0x00000008
#define WTS_EVENT_DISCONNECT		0x00000010
#define WTS_EVENT_LOGON				0x00000020
#define WTS_EVENT_LOGOFF			0x00000040
#define WTS_EVENT_STATECHANGE		0x00000080
#define WTS_EVENT_LICENSE			0x00000100
#define WTS_EVENT_ALL				0x7FFFFFFF
#define WTS_EVENT_FLUSH				0x80000000

BOOL WINAPI WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags);
BOOL WINAPI WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait);
#endif /* _WIN32_WINNT >= 0x0500 */

#ifdef __cplusplus
}
#endif

#endif /* _WTSAPI32_H */