|
| 1 | +#pragma once |
| 2 | + |
| 3 | +//at the time of writing, <wtsapi32.h> of MinGW doesn't have the definition of WTSEnumerateSessionsExW and friends |
| 4 | + |
| 5 | +#if (_WIN32_WINNT >= 0x0601) |
| 6 | + |
| 7 | +typedef struct _WTS_SESSION_INFO_1A { |
| 8 | + DWORD ExecEnvId; |
| 9 | + WTS_CONNECTSTATE_CLASS State; |
| 10 | + DWORD SessionId; |
| 11 | + LPSTR pSessionName; |
| 12 | + LPSTR pHostName; |
| 13 | + LPSTR pUserName; |
| 14 | + LPSTR pDomainName; |
| 15 | + LPSTR pFarmName; |
| 16 | +} WTS_SESSION_INFO_1A, *PWTS_SESSION_INFO_1A; |
| 17 | + |
| 18 | +typedef struct _WTS_SESSION_INFO_1W { |
| 19 | + DWORD ExecEnvId; |
| 20 | + WTS_CONNECTSTATE_CLASS State; |
| 21 | + DWORD SessionId; |
| 22 | + LPWSTR pSessionName; |
| 23 | + LPWSTR pHostName; |
| 24 | + LPWSTR pUserName; |
| 25 | + LPWSTR pDomainName; |
| 26 | + LPWSTR pFarmName; |
| 27 | +} WTS_SESSION_INFO_1W, * PWTS_SESSION_INFO_1W; |
| 28 | + |
| 29 | +#define WTS_SESSION_INFO_1 __MINGW_NAME_AW(WTS_SESSION_INFO_1) |
| 30 | +#define PWTS_SESSION_INFO_1 __MINGW_NAME_AW(PWTS_SESSION_INFO_1) |
| 31 | + |
| 32 | +WINBOOL WINAPI WTSEnumerateSessionsExA(HANDLE hServer,DWORD* pLevel,DWORD Filter,PWTS_SESSION_INFO_1A* ppSessionInfo,DWORD* pCount); |
| 33 | +WINBOOL WINAPI WTSEnumerateSessionsExW(HANDLE hServer,DWORD* pLevel,DWORD Filter,PWTS_SESSION_INFO_1W* ppSessionInfo,DWORD* pCount); |
| 34 | +#define WTSEnumerateSessionsEx __MINGW_NAME_AW(WTSEnumerateSessionsEx) |
| 35 | + |
| 36 | +typedef enum _WTS_TYPE_CLASS { |
| 37 | + WTSTypeProcessInfoLevel0, |
| 38 | + WTSTypeProcessInfoLevel1, |
| 39 | + WTSTypeSessionInfoLevel1 |
| 40 | +} WTS_TYPE_CLASS; |
| 41 | +BOOL WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass,PVOID pMemory,ULONG NumberOfEntries); |
| 42 | +BOOL WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass,PVOID pMemory,ULONG NumberOfEntries); |
| 43 | +#define WTSFreeMemoryEx __MINGW_NAME_AW(WTSFreeMemoryEx) |
| 44 | + |
| 45 | +#endif /*(_WIN32_WINNT >= 0x0601)*/ |
0 commit comments