Leaked source code of windows server 2003
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.

267 lines
8.2 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1993 **/
  4. /**********************************************************************/
  5. /*
  6. Chat.h
  7. This file contains constants & type definitions shared between the
  8. CHAT Service, Installer, and Administration UI.
  9. FILE HISTORY:
  10. KeithMo 10-Mar-1993 Created.
  11. KentCe 11-Dec-1995 Imported for new chat server
  12. */
  13. #ifndef _CHAT_H_
  14. #define _CHAT_H_
  15. #ifdef __cplusplus
  16. extern "C"
  17. {
  18. #endif // _cplusplus
  19. #if !defined(MIDL_PASS)
  20. #include <winsock.h>
  21. #endif
  22. //
  23. // Name of directory annotation file. If this file exists
  24. // in the target directory of a CWD command, its contents
  25. // will be sent to the user as part of the CWD reply.
  26. //
  27. #define CHAT_ANNOTATION_FILE_A "~CHATSVC~.CKM"
  28. #define CHAT_ANNOTATION_FILE_W L"~CHATSVC~.CKM"
  29. //
  30. // Configuration parameters registry key.
  31. //
  32. # define CHAT_SERVICE_KEY_A \
  33. "System\\CurrentControlSet\\Services\\" ## CHAT_SERVICE_NAME_A
  34. # define CHAT_SERVICE_KEY_W \
  35. L"System\\CurrentControlSet\\Services\\" ## CHAT_SERVICE_NAME_W
  36. #define CHAT_PARAMETERS_KEY_A CHAT_SERVICE_KEY_A ## "\\Parameters"
  37. #define CHAT_PARAMETERS_KEY_W CHAT_SERVICE_KEY_W ## L"\\Parameters"
  38. //
  39. // Performance key.
  40. //
  41. #define CHAT_PERFORMANCE_KEY_A CHAT_SERVICE_KEY_A ## "\\Performance"
  42. #define CHAT_PERFORMANCE_KEY_W CHAT_SERVICE_KEY_W ## L"\\Performance"
  43. //
  44. // If this registry key exists under the Parameters key,
  45. // it is used to validate CHATSVC access. Basically, all new users
  46. // must have sufficient privilege to open this key before they
  47. // may access the CHAT Server.
  48. //
  49. #define CHAT_ACCESS_KEY_A "AccessCheck"
  50. #define CHAT_ACCESS_KEY_W L"AccessCheck"
  51. //
  52. // Configuration value names.
  53. //
  54. #define CHAT_ALLOW_ANONYMOUS_A "AllowAnonymous"
  55. #define CHAT_ALLOW_ANONYMOUS_W L"AllowAnonymous"
  56. #define CHAT_ALLOW_GUEST_ACCESS_A "AllowGuestAccess"
  57. #define CHAT_ALLOW_GUEST_ACCESS_W L"AllowGuestAccess"
  58. #define CHAT_ANONYMOUS_ONLY_A "AnonymousOnly"
  59. #define CHAT_ANONYMOUS_ONLY_W L"AnonymousOnly"
  60. #define CHAT_MSDOS_DIR_OUTPUT_A "MsdosDirOutput"
  61. #define CHAT_MSDOS_DIR_OUTPUT_W L"MsdosDirOutput"
  62. #define CHAT_GREETING_MESSAGE_A "GreetingMessage"
  63. #define CHAT_GREETING_MESSAGE_W L"GreetingMessage"
  64. #define CHAT_EXIT_MESSAGE_A "ExitMessage"
  65. #define CHAT_EXIT_MESSAGE_W L"ExitMessage"
  66. #define CHAT_MAX_CLIENTS_MSG_A "MaxClientsMessage"
  67. #define CHAT_MAX_CLIENTS_MSG_W L"MaxClientsMessage"
  68. #define CHAT_DEBUG_FLAGS_A "DebugFlags"
  69. #define CHAT_DEBUG_FLAGS_W L"DebugFlags"
  70. #define CHAT_ANNOTATE_DIRS_A "AnnotateDirectories"
  71. #define CHAT_ANNOTATE_DIRS_W L"AnnotateDirectories"
  72. #define CHAT_LOWERCASE_FILES_A "LowercaseFiles"
  73. #define CHAT_LOWERCASE_FILES_W L"LowercaseFiles"
  74. #define CHAT_LISTEN_BACKLOG_A "ListenBacklog"
  75. #define CHAT_LISTEN_BACKLOG_W L"ListenBacklog"
  76. #define CHAT_ENABLE_LICENSING_A "EnableLicensing"
  77. #define CHAT_ENABLE_LICENSING_W L"EnableLicensing"
  78. #define CHAT_DEFAULT_LOGON_DOMAIN_A "DefaultLogonDomain"
  79. #define CHAT_DEFAULT_LOGON_DOMAIN_W L"DefaultLogonDomain"
  80. //
  81. // Name of the LSA Secret Object containing the password for
  82. // anonymous logon and virtual UNC roots
  83. //
  84. #define CHAT_ANONYMOUS_SECRET_A "CHAT_ANONYMOUS_DATA"
  85. #define CHAT_ANONYMOUS_SECRET_W L"CHAT_ANONYMOUS_DATA"
  86. #define CHAT_ROOT_SECRET_A "CHAT_ROOT_DATA"
  87. #define CHAT_ROOT_SECRET_W L"CHAT_ROOT_DATA"
  88. //
  89. // Handle ANSI/UNICODE sensitivity.
  90. //
  91. #ifdef UNICODE
  92. #define CHAT_ANNOTATION_FILE CHAT_ANNOTATION_FILE_W
  93. #define CHAT_PARAMETERS_KEY CHAT_PARAMETERS_KEY_W
  94. #define CHAT_PERFORMANCE_KEY CHAT_PERFORMANCE_KEY_W
  95. #define CHAT_ACCESS_KEY CHAT_ACCESS_KEY_W
  96. #define CHAT_ALLOW_ANONYMOUS CHAT_ALLOW_ANONYMOUS_W
  97. #define CHAT_ALLOW_GUEST_ACCESS CHAT_ALLOW_GUEST_ACCESS_W
  98. #define CHAT_ANONYMOUS_ONLY CHAT_ANONYMOUS_ONLY_W
  99. #define CHAT_MSDOS_DIR_OUTPUT CHAT_MSDOS_DIR_OUTPUT_W
  100. #define CHAT_GREETING_MESSAGE CHAT_GREETING_MESSAGE_W
  101. #define CHAT_EXIT_MESSAGE CHAT_EXIT_MESSAGE_W
  102. #define CHAT_MAX_CLIENTS_MSG CHAT_MAX_CLIENTS_MSG_W
  103. #define CHAT_DEBUG_FLAGS CHAT_DEBUG_FLAGS_W
  104. #define CHAT_ANNOTATE_DIRS CHAT_ANNOTATE_DIRS_W
  105. #define CHAT_ANONYMOUS_SECRET CHAT_ANONYMOUS_SECRET_W
  106. #define CHAT_LOWERCASE_FILES CHAT_LOWERCASE_FILES_W
  107. #define CHAT_LISTEN_BACKLOG CHAT_LISTEN_BACKLOG_W
  108. #define CHAT_ENABLE_LICENSING CHAT_ENABLE_LICENSING_W
  109. #define CHAT_DEFAULT_LOGON_DOMAIN CHAT_DEFAULT_LOGON_DOMAIN_W
  110. #else // !UNICODE
  111. #define CHAT_ANNOTATION_FILE CHAT_ANNOTATION_FILE_A
  112. #define CHAT_PARAMETERS_KEY CHAT_PARAMETERS_KEY_A
  113. #define CHAT_PERFORMANCE_KEY CHAT_PERFORMANCE_KEY_A
  114. #define CHAT_ACCESS_KEY CHAT_ACCESS_KEY_A
  115. #define CHAT_ANONYMOUS_ONLY CHAT_ANONYMOUS_ONLY_A
  116. #define CHAT_ALLOW_ANONYMOUS CHAT_ALLOW_ANONYMOUS_A
  117. #define CHAT_ALLOW_GUEST_ACCESS CHAT_ALLOW_GUEST_ACCESS_A
  118. #define CHAT_MSDOS_DIR_OUTPUT CHAT_MSDOS_DIR_OUTPUT_A
  119. #define CHAT_GREETING_MESSAGE CHAT_GREETING_MESSAGE_A
  120. #define CHAT_EXIT_MESSAGE CHAT_EXIT_MESSAGE_A
  121. #define CHAT_MAX_CLIENTS_MSG CHAT_MAX_CLIENTS_MSG_A
  122. #define CHAT_DEBUG_FLAGS CHAT_DEBUG_FLAGS_A
  123. #define CHAT_ANNOTATE_DIRS CHAT_ANNOTATE_DIRS_A
  124. #define CHAT_ANONYMOUS_SECRET CHAT_ANONYMOUS_SECRET_A
  125. #define CHAT_LOWERCASE_FILES CHAT_LOWERCASE_FILES_A
  126. #define CHAT_LISTEN_BACKLOG CHAT_LISTEN_BACKLOG_A
  127. #define CHAT_ENABLE_LICENSING CHAT_ENABLE_LICENSING_A
  128. #define CHAT_DEFAULT_LOGON_DOMAIN CHAT_DEFAULT_LOGON_DOMAIN_A
  129. #endif // UNICODE
  130. //
  131. // Structures for APIs
  132. //
  133. typedef struct _CHAT_USER_INFO
  134. {
  135. DWORD idUser; // User id
  136. LPWSTR pszUser; // User name
  137. BOOL fAnonymous; // TRUE if the user is logged on as
  138. // Anonymous, FALSE otherwise
  139. DWORD inetHost; // Host Address
  140. DWORD tConnect; // User Connection Time (elapsed seconds)
  141. } CHAT_USER_INFO, * LPCHAT_USER_INFO;
  142. typedef struct _CHAT_STATISTICS_0
  143. {
  144. LARGE_INTEGER TotalBytesSent;
  145. LARGE_INTEGER TotalBytesReceived;
  146. DWORD TotalFilesSent;
  147. DWORD TotalFilesReceived;
  148. DWORD CurrentAnonymousUsers;
  149. DWORD CurrentNonAnonymousUsers;
  150. DWORD TotalAnonymousUsers;
  151. DWORD TotalNonAnonymousUsers;
  152. DWORD MaxAnonymousUsers;
  153. DWORD MaxNonAnonymousUsers;
  154. DWORD CurrentConnections;
  155. DWORD MaxConnections;
  156. DWORD ConnectionAttempts;
  157. DWORD LogonAttempts;
  158. DWORD TimeOfLastClear;
  159. } CHAT_STATISTICS_0, * LPCHAT_STATISTICS_0;
  160. //
  161. // API Prototypes
  162. //
  163. NET_API_STATUS
  164. I_ChatEnumerateUsers(
  165. IN LPWSTR pszServer OPTIONAL,
  166. OUT LPDWORD lpdwEntriesRead,
  167. OUT LPCHAT_USER_INFO * Buffer
  168. );
  169. NET_API_STATUS
  170. I_ChatDisconnectUser(
  171. IN LPWSTR pszServer OPTIONAL,
  172. IN DWORD idUser
  173. );
  174. NET_API_STATUS
  175. I_ChatQueryVolumeSecurity(
  176. IN LPWSTR pszServer OPTIONAL,
  177. OUT LPDWORD lpdwReadAccess,
  178. OUT LPDWORD lpdwWriteAccess
  179. );
  180. NET_API_STATUS
  181. I_ChatSetVolumeSecurity(
  182. IN LPWSTR pszServer OPTIONAL,
  183. IN DWORD dwReadAccess,
  184. IN DWORD dwWriteAccess
  185. );
  186. NET_API_STATUS
  187. I_ChatQueryStatistics(
  188. IN LPWSTR pszServer OPTIONAL,
  189. IN DWORD Level,
  190. OUT LPBYTE * Buffer
  191. );
  192. NET_API_STATUS
  193. I_ChatClearStatistics(
  194. IN LPWSTR pszServer OPTIONAL
  195. );
  196. #ifdef __cplusplus
  197. }
  198. #endif // _cplusplus
  199. #endif // _CHAT_H_