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.

105 lines
3.4 KiB

  1. /*******************************************************************************
  2. *
  3. * CTXDEF.H
  4. *
  5. * TerminalServer API support (typedefs).
  6. *
  7. * copyright notice: Microsoft Corporation 1998
  8. *
  9. *
  10. *******************************************************************************/
  11. /***********
  12. * Defines
  13. ***********/
  14. #define WINSTATIONNAME_LENGTH 32
  15. /*
  16. * Event flags for CtxWinStationWaitEvent
  17. */
  18. #define WEVENT_NONE 0x00000000
  19. #define WEVENT_CREATE 0x00000001 // new WinStation created
  20. #define WEVENT_DELETE 0x00000002 // existing WinStation deleted
  21. #define WEVENT_RENAME 0x00000004 // existing WinStation renamed
  22. #define WEVENT_CONNECT 0x00000008 // WinStation connect to client
  23. #define WEVENT_DISCONNECT 0x00000010 // WinStation logged on without client
  24. #define WEVENT_LOGON 0x00000020 // user logon to existing WinStation
  25. #define WEVENT_LOGOFF 0x00000040 // user logoff from existing WinStation
  26. #define WEVENT_STATECHANGE 0x00000080 // WinStation state change
  27. #define WEVENT_LICENSE 0x00000100 // License state change
  28. #define WEVENT_ALL 0x7fffffff // wait for all event types
  29. #define WEVENT_FLUSH 0x80000000 // unblock all waiters
  30. /************
  31. * Typedefs
  32. ************/
  33. typedef WCHAR WINSTATIONNAMEW[ WINSTATIONNAME_LENGTH + 1 ];
  34. typedef WCHAR * PWINSTATIONNAMEW;
  35. typedef CHAR WINSTATIONNAMEA[ WINSTATIONNAME_LENGTH + 1 ];
  36. typedef CHAR * PWINSTATIONNAMEA;
  37. #ifdef UNICODE
  38. #define WINSTATIONNAME WINSTATIONNAMEW
  39. #define PWINSTATIONNAME PWINSTATIONNAMEW
  40. #else
  41. #define WINSTATIONNAME WINSTATIONNAMEA
  42. #define PWINSTATIONNAME PWINSTATIONNAMEA
  43. #endif /* UNICODE */
  44. /*
  45. * WinStation connect states
  46. */
  47. typedef enum _WINSTATIONSTATECLASS {
  48. State_Active, // user logged on to WinStation
  49. State_Connected, // WinStation connected to client
  50. State_ConnectQuery, // in the process of connecting to client
  51. State_Shadow, // shadowing another WinStation
  52. State_Disconnected, // WinStation logged on without client
  53. State_Idle, // waiting for client to connect
  54. State_Listen, // WinStation is listening for connection
  55. State_Reset, // WinStation is being reset
  56. State_Down, // WinStation is down due to error
  57. State_Init, // WinStation in initialization
  58. } WINSTATIONSTATECLASS;
  59. typedef struct _SESSIONIDW {
  60. union {
  61. ULONG SessionId;
  62. ULONG LogonId; // internal use only
  63. };
  64. WINSTATIONNAMEW WinStationName;
  65. WINSTATIONSTATECLASS State;
  66. } SESSIONIDW, * PSESSIONIDW;
  67. typedef struct _SESSIONIDA {
  68. union {
  69. ULONG SessionId;
  70. ULONG LogonId; // internal use only
  71. };
  72. WINSTATIONNAMEA WinStationName;
  73. WINSTATIONSTATECLASS State;
  74. } SESSIONIDA, * PSESSIONIDA;
  75. #ifdef UNICODE
  76. #define SESSIONID SESSIONIDW
  77. #define PSESSIONID PSESSIONIDW
  78. #else
  79. #define SESSIONID SESSIONIDA
  80. #define PSESSIONID PSESSIONIDA
  81. #endif /* UNICODE */
  82. /*
  83. * NtUserCtxConnectState() values
  84. * Used by routines that can't use WinStation API calls
  85. * like DLL init routines.
  86. */
  87. #define CTX_W32_CONNECT_STATE_CONSOLE 0
  88. #define CTX_W32_CONNECT_STATE_IDLE 1
  89. #define CTX_W32_CONNECT_STATE_EXIT_IN_PROGRESS 2
  90. #define CTX_W32_CONNECT_STATE_CONNECTED 3
  91. #define CTX_W32_CONNECT_STATE_DISCONNECTED 4