8 #define WINSTATION_QUERY 0x00000001 // WinStationQueryInformation
9 #define WINSTATION_SET 0x00000002 // WinStationSetInformation
10 #define WINSTATION_RESET 0x00000004 // WinStationReset
11 #define WINSTATION_VIRTUAL 0x00000008 //read/write direct data
12 #define WINSTATION_SHADOW 0x00000010 // WinStationShadow
13 #define WINSTATION_LOGON 0x00000020 // logon to WinStation
14 #define WINSTATION_LOGOFF 0x00000040 // WinStationLogoff
15 #define WINSTATION_MSG 0x00000080 // WinStationMsg
16 #define WINSTATION_CONNECT 0x00000100 // WinStationConnect
17 #define WINSTATION_DISCONNECT 0x00000200 // WinStationDisconnect
18 #define WINSTATION_GUEST_ACCESS WINSTATION_LOGON
20 #define WINSTATION_CURRENT_GUEST_ACCESS (WINSTATION_VIRTUAL | WINSTATION_LOGOFF)
21 #define WINSTATION_USER_ACCESS (WINSTATION_GUEST_ACCESS | WINSTATION_QUERY | WINSTATION_CONNECT)
22 #define WINSTATION_CURRENT_USER_ACCESS \
23 (WINSTATION_SET | WINSTATION_RESET | WINSTATION_VIRTUAL | \
24 WINSTATION_LOGOFF | WINSTATION_DISCONNECT)
25 #define WINSTATION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | WINSTATION_QUERY | \
26 WINSTATION_SET | WINSTATION_RESET | WINSTATION_VIRTUAL | \
27 WINSTATION_SHADOW | WINSTATION_LOGON | WINSTATION_MSG | \
28 WINSTATION_CONNECT | WINSTATION_DISCONNECT)
30 #define WDPREFIX_LENGTH 12
31 #define STACK_ADDRESS_LENGTH 128
32 #define MAX_BR_NAME 65
33 #define DIRECTORY_LENGTH 256
34 #define INITIALPROGRAM_LENGTH 256
35 #define USERNAME_LENGTH 20
36 #define DOMAIN_LENGTH 17
37 #define PASSWORD_LENGTH 14
38 #define NASISPECIFICNAME_LENGTH 14
39 #define NASIUSERNAME_LENGTH 47
40 #define NASIPASSWORD_LENGTH 24
41 #define NASISESSIONNAME_LENGTH 16
42 #define NASIFILESERVER_LENGTH 47
44 #define CLIENTDATANAME_LENGTH 7
45 #define CLIENTNAME_LENGTH 20
46 #define CLIENTADDRESS_LENGTH 30
47 #define IMEFILENAME_LENGTH 32
48 #define DIRECTORY_LENGTH 256
49 #define CLIENTLICENSE_LENGTH 32
50 #define CLIENTMODEM_LENGTH 40
51 #define CLIENT_PRODUCT_ID_LENGTH 32
52 #define MAX_COUNTER_EXTENSIONS 2
53 #define WINSTATIONNAME_LENGTH 32
55 #define TERMSRV_TOTAL_SESSIONS 1
56 #define TERMSRV_DISC_SESSIONS 2
57 #define TERMSRV_RECON_SESSIONS 3
58 #define TERMSRV_CURRENT_ACTIVE_SESSIONS 4
59 #define TERMSRV_CURRENT_DISC_SESSIONS 5
60 #define TERMSRV_PENDING_SESSIONS 6
61 #define TERMSRV_SUCC_TOTAL_LOGONS 7
62 #define TERMSRV_SUCC_LOCAL_LOGONS 8
63 #define TERMSRV_SUCC_REMOTE_LOGONS 9
64 #define TERMSRV_SUCC_SESSION0_LOGONS 10
65 #define TERMSRV_CURRENT_TERMINATING_SESSIONS 11
66 #define TERMSRV_CURRENT_LOGGEDON_SESSIONS 12
244 #define MAX_THINWIRECACHE 4
394 #define TS_PROCESS_INFO_MAGIC_NT4 0x23495452
404 #define SIZEOF_TS4_SYSTEM_THREAD_INFORMATION 64
405 #define SIZEOF_TS4_SYSTEM_PROCESS_INFORMATION 136
459 #define WSD_LOGOFF 0x1
460 #define WSD_SHUTDOWN 0x2
461 #define WSD_REBOOT 0x4
462 #define WSD_POWEROFF 0x8
465 #define WEVENT_NONE 0x0
466 #define WEVENT_CREATE 0x1
467 #define WEVENT_DELETE 0x2
468 #define WEVENT_RENAME 0x4
469 #define WEVENT_CONNECT 0x8
470 #define WEVENT_DISCONNECT 0x10
471 #define WEVENT_LOGON 0x20
472 #define WEVENT_LOGOFF 0x40
473 #define WEVENT_STATECHANGE 0x80
474 #define WEVENT_LICENSE 0x100
475 #define WEVENT_ALL 0x7fffffff
476 #define WEVENT_FLUSH 0x80000000
485 #define WNOTIFY_ALL_SESSIONS 0x1
492 #define LOGONID_CURRENT (-1)
493 #define SERVERNAME_CURRENT (NULL)
506 _In_ PWSTR ServerName
520 _In_opt_ HANDLE hServer
527 _In_opt_ HANDLE hServer,
529 _Inout_ PTS_COUNTER Counters
535 _In_opt_ HANDLE hServer,
536 _In_ ULONG ShutdownFlags
543 _In_opt_ HANDLE hServer,
544 _In_ ULONG EventMask,
545 _Out_ PULONG EventFlags
552 _In_opt_ HANDLE hServer,
553 _In_ HWND WindowHandle,
561 _In_opt_ HANDLE hServer,
562 _In_ HWND WindowHandle
571 _In_opt_ HANDLE hServer,
572 _Out_ PSESSIONIDW *SessionIds,
579 _In_opt_ HANDLE hServer,
580 _In_ ULONG SessionId,
582 _Out_writes_bytes_(WinStationInformationLength) PVOID pWinStationInformation,
583 _In_ ULONG WinStationInformationLength,
584 _Out_ PULONG pReturnLength
591 _In_opt_ HANDLE hServer,
592 _In_ ULONG SessionId,
594 _In_reads_bytes_(WinStationInformationLength) PVOID pWinStationInformation,
595 _In_ ULONG WinStationInformationLength
601 _In_opt_ HANDLE hServer,
602 _In_ ULONG SessionId,
610 _In_opt_ HANDLE hServer,
611 _In_ ULONG SessionId,
613 _In_ ULONG TitleLength,
615 _In_ ULONG MessageLength,
618 _Out_ PULONG Response,
619 _In_ BOOLEAN DoNotWait
625 _In_opt_ HANDLE hServer,
626 _In_ ULONG SessionId,
627 _In_ ULONG TargetSessionId,
628 _In_opt_ PWSTR pPassword,
635 _In_opt_ HANDLE hServer,
636 _In_ ULONG SessionId,
644 _In_opt_ HANDLE hServer,
645 _In_ ULONG SessionId,
653 _In_opt_ HANDLE hServer,
654 _In_ PWSTR TargetServerName,
655 _In_ ULONG TargetSessionId,
657 _In_ USHORT HotkeyModifiers
664 _In_opt_ HANDLE hServer,
665 _In_ ULONG SessionId,
675 _In_opt_ HANDLE hServer,
676 _Out_ PVOID *Processes
683 _In_opt_ HANDLE hServer,
685 _Out_ PULONG NumberOfProcesses,
686 _Out_ PTS_ALL_PROCESSES_INFO *Processes
694 _In_ PTS_ALL_PROCESSES_INFO Processes,
695 _In_ ULONG NumberOfProcesses
702 _In_opt_ HANDLE hServer,
710 _In_opt_ HANDLE hServer,
712 _In_ FILETIME ProcessStartTime,
713 _Out_ PVOID pProcessUserSid,
714 _Inout_ PULONG dwSidSize
719 #if (PHNT_VERSION >= PHNT_VISTA)