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.

1156 lines
36 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. inetinfo.h
  5. Abstract:
  6. This file contains the internet info server admin APIs.
  7. Author:
  8. Madan Appiah (madana) 10-Oct-1995
  9. Revision History:
  10. Madana 10-Oct-1995 Made a new copy for product split from inetasrv.h
  11. MuraliK 12-Oct-1995 Fixes to support product split
  12. MuraliK 15-Nov-1995 Support Wide Char interface names
  13. --*/
  14. #ifndef _INETINFO_H_
  15. #define _INETINFO_H_
  16. # include "inetcom.h"
  17. #ifdef __cplusplus
  18. extern "C"
  19. {
  20. #endif // _cplusplus
  21. /************************************************************
  22. * Symbolic Constants
  23. ************************************************************/
  24. //
  25. // The total number of instances of common services using the commong
  26. // service counters
  27. //
  28. #define MAX_PERF_CTR_SVCS 3
  29. #define LAST_PERF_CTR_SVC INET_HTTP
  30. #ifndef NO_AUX_PERF
  31. #ifndef MAX_AUX_PERF_COUNTERS
  32. #define MAX_AUX_PERF_COUNTERS (20)
  33. #endif // MAX_AUX_PERF_COUNTERS
  34. #endif // NO_AUX_PERF
  35. //
  36. // Service name.
  37. //
  38. #define INET_INFO_SERVICE_NAME TEXT("INETINFO")
  39. #define INET_INFO_SERVICE_NAME_A "INETINFO"
  40. #define INET_INFO_SERVICE_NAME_W L"INETINFO"
  41. //
  42. // Configuration parameters registry key.
  43. //
  44. #define INET_INFO_KEY \
  45. TEXT("System\\CurrentControlSet\\Services\\InetInfo")
  46. #define INET_INFO_PARAMETERS_KEY \
  47. INET_INFO_KEY TEXT("\\Parameters")
  48. //
  49. // If this registry key exists under the W3Svc\Parameters key,
  50. // it is used to validate server access. Basically, all new users
  51. // must have sufficient privilege to open this key before they
  52. // may access the Server.
  53. //
  54. #define INET_INFO_ACCESS_KEY TEXT("AccessCheck")
  55. //
  56. // Authentication requirements values
  57. //
  58. #define INET_INFO_AUTH_ANONYMOUS 0x00000001
  59. #define INET_INFO_AUTH_CLEARTEXT 0x00000002 // Includes HTTP Basic
  60. #define INET_INFO_AUTH_NT_AUTH 0x00000004
  61. //
  62. // Name of the LSA Secret Object containing the password for
  63. // anonymous logon.
  64. //
  65. #define INET_INFO_ANONYMOUS_SECRET TEXT("INET_INFO_ANONYMOUS_DATA")
  66. #define INET_INFO_ANONYMOUS_SECRET_A "INET_INFO_ANONYMOUS_DATA"
  67. #define INET_INFO_ANONYMOUS_SECRET_W L"INET_INFO_ANONYMOUS_DATA"
  68. /////////////////////////////////////////////////////////////////////////
  69. // //
  70. // Internet Server Common Definitions //
  71. // //
  72. /////////////////////////////////////////////////////////////////////////
  73. //
  74. // Client Interface Name for RPC connections over named pipes
  75. //
  76. # define INET_INFO_INTERFACE_NAME INET_INFO_SERVICE_NAME
  77. # define INET_INFO_NAMED_PIPE TEXT("\\PIPE\\") ## INET_INFO_INTERFACE_NAME
  78. # define INET_INFO_NAMED_PIPE_W L"\\PIPE\\" ## INET_INFO_SERVICE_NAME_W
  79. //
  80. // Field control values for the INET_INFO_CONFIG_INFO structure
  81. //
  82. #define FC_INET_INFO_AUTHENTICATION ((FIELD_CONTROL)BitFlag(16))
  83. #define FC_INET_INFO_ALLOW_ANONYMOUS ((FIELD_CONTROL)BitFlag(17))
  84. #define FC_INET_INFO_LOG_ANONYMOUS ((FIELD_CONTROL)BitFlag(18))
  85. #define FC_INET_INFO_LOG_NONANONYMOUS ((FIELD_CONTROL)BitFlag(19))
  86. #define FC_INET_INFO_ANON_USER_NAME ((FIELD_CONTROL)BitFlag(20))
  87. #define FC_INET_INFO_ANON_PASSWORD ((FIELD_CONTROL)BitFlag(21))
  88. #define FC_INET_INFO_PORT_NUMBER ((FIELD_CONTROL)BitFlag(22))
  89. #define FC_INET_INFO_SITE_SECURITY ((FIELD_CONTROL)BitFlag(23))
  90. #define FC_INET_INFO_VIRTUAL_ROOTS ((FIELD_CONTROL)BitFlag(24))
  91. // common parameters for publishing servers only
  92. # define FC_INET_INFO_PUBLISHING_SVCS_ALL (FC_INET_INFO_AUTHENTICATION | \
  93. FC_INET_INFO_ALLOW_ANONYMOUS | \
  94. FC_INET_INFO_LOG_ANONYMOUS | \
  95. FC_INET_INFO_LOG_NONANONYMOUS | \
  96. FC_INET_INFO_ANON_USER_NAME | \
  97. FC_INET_INFO_ANON_PASSWORD | \
  98. FC_INET_INFO_PORT_NUMBER | \
  99. FC_INET_INFO_SITE_SECURITY | \
  100. FC_INET_INFO_VIRTUAL_ROOTS \
  101. )
  102. #define FC_INET_INFO_ALL \
  103. (FC_INET_INFO_PUBLISHING_SVCS_ALL| \
  104. FC_INET_COM_ALL)
  105. //
  106. // Virtual root access mask values
  107. //
  108. #define VROOT_MASK_READ 0x00000001
  109. #define VROOT_MASK_WRITE 0x00000002
  110. #define VROOT_MASK_EXECUTE 0x00000004
  111. #define VROOT_MASK_SSL 0x00000008
  112. #define VROOT_MASK_DONT_CACHE 0x00000010
  113. #define VROOT_MASK_MASK 0x0000001f
  114. //
  115. // INet admin API structures
  116. //
  117. typedef struct _INET_INFO_IP_SEC_ENTRY
  118. {
  119. DWORD dwMask; // Mask and network number in
  120. DWORD dwNetwork; // network order
  121. } INET_INFO_IP_SEC_ENTRY, *LPINET_INFO_IP_SEC_ENTRY;
  122. #pragma warning( disable:4200 ) // nonstandard ext. - zero sized array
  123. // (MIDL requires zero entries)
  124. typedef struct _INET_INFO_IP_SEC_LIST
  125. {
  126. DWORD cEntries;
  127. #ifdef MIDL_PASS
  128. [size_is( cEntries)]
  129. #endif
  130. INET_INFO_IP_SEC_ENTRY aIPSecEntry[];
  131. } INET_INFO_IP_SEC_LIST, *LPINET_INFO_IP_SEC_LIST;
  132. typedef struct _INET_INFO_VIRTUAL_ROOT_ENTRY
  133. {
  134. LPWSTR pszRoot; // Virtual root name
  135. LPWSTR pszAddress; // Optional IP address
  136. LPWSTR pszDirectory; // Physical direcotry
  137. DWORD dwMask; // Mask for this virtual root
  138. LPWSTR pszAccountName; // Account to connect as
  139. WCHAR AccountPassword[PWLEN+1]; // Password for pszAccountName
  140. DWORD dwError; // Error code if entry wasn't added
  141. // only used for gets
  142. } INET_INFO_VIRTUAL_ROOT_ENTRY, *LPINET_INFO_VIRTUAL_ROOT_ENTRY;
  143. typedef struct _INET_INFO_VIRTUAL_ROOT_LIST
  144. {
  145. DWORD cEntries;
  146. #ifdef MIDL_PASS
  147. [size_is( cEntries)]
  148. #endif
  149. INET_INFO_VIRTUAL_ROOT_ENTRY aVirtRootEntry[];
  150. } INET_INFO_VIRTUAL_ROOT_LIST, *LPINET_INFO_VIRTUAL_ROOT_LIST;
  151. //
  152. // Admin configuration information
  153. //
  154. typedef struct _INET_INFO_CONFIG_INFO
  155. {
  156. FIELD_CONTROL FieldControl;
  157. //
  158. // don't add any service specific config parameter here.
  159. //
  160. INET_COM_CONFIG_INFO CommonConfigInfo;
  161. BOOL fLogAnonymous; // Log Anonymous users?
  162. BOOL fLogNonAnonymous; // Log Non anonymous users?
  163. LPWSTR lpszAnonUserName; // Anonymous user name?
  164. WCHAR szAnonPassword[PWLEN+1]; // Password for the anonymous user
  165. DWORD dwAuthentication; // What authentication is enabled?
  166. short sPort; // Port Number for service
  167. LPINET_INFO_IP_SEC_LIST DenyIPList; // Site security deny list
  168. LPINET_INFO_IP_SEC_LIST GrantIPList; // Site security grant list
  169. LPINET_INFO_VIRTUAL_ROOT_LIST VirtualRoots; // Symlinks to other data dirs
  170. //
  171. // add more service specific parameters here.
  172. //
  173. } INET_INFO_CONFIG_INFO, * LPINET_INFO_CONFIG_INFO;
  174. /////////////////////////////////////////////////////////////////////////
  175. // //
  176. // Global Internet Server Definitions //
  177. // //
  178. /////////////////////////////////////////////////////////////////////////
  179. #define FC_GINET_INFO_BANDWIDTH_LEVEL ((FIELD_CONTROL)BitFlag(0))
  180. #define FC_GINET_INFO_MEMORY_CACHE_SIZE ((FIELD_CONTROL)BitFlag(1))
  181. #define FC_GINET_INFO_ALL \
  182. ( FC_GINET_INFO_BANDWIDTH_LEVEL | \
  183. FC_GINET_INFO_MEMORY_CACHE_SIZE | \
  184. 0 \
  185. )
  186. typedef struct _INET_INFO_GLOBAL_CONFIG_INFO
  187. {
  188. FIELD_CONTROL FieldControl;
  189. DWORD BandwidthLevel; // Bandwidth Level used.
  190. DWORD cbMemoryCacheSize;
  191. } INET_INFO_GLOBAL_CONFIG_INFO, * LPINET_INFO_GLOBAL_CONFIG_INFO;
  192. //
  193. // Global statistics
  194. //
  195. typedef struct _INET_INFO_STATISTICS_0
  196. {
  197. INET_COM_CACHE_STATISTICS CacheCtrs;
  198. INET_COM_ATQ_STATISTICS AtqCtrs;
  199. # ifndef NO_AUX_PERF
  200. DWORD nAuxCounters; // number of active counters in rgCounters
  201. DWORD rgCounters[MAX_AUX_PERF_COUNTERS];
  202. # endif // NO_AUX_PERF
  203. } INET_INFO_STATISTICS_0, * LPINET_INFO_STATISTICS_0;
  204. //
  205. // Capabilities Flags
  206. //
  207. typedef struct _INET_INFO_CAP_FLAGS {
  208. DWORD Flag; // Which capabilities are enabled
  209. DWORD Mask; // Which capabilities are supported
  210. } INET_INFO_CAP_FLAGS, * LPINET_INFO_CAP_FLAGS;
  211. //
  212. // Inet info server capabilities
  213. //
  214. typedef struct _INET_INFO_CAPABILITIES {
  215. DWORD CapVersion; // Version number of this structure
  216. DWORD ProductType; // Product type
  217. DWORD MajorVersion; // Major version number
  218. DWORD MinorVersion; // Minor Version number
  219. DWORD BuildNumber; // Build number
  220. DWORD NumCapFlags; // Number of capabilities structures
  221. LPINET_INFO_CAP_FLAGS CapFlags;
  222. } INET_INFO_CAPABILITIES, * LPINET_INFO_CAPABILITIES;
  223. //
  224. // Product type
  225. //
  226. #define INET_INFO_PRODUCT_NTSERVER 0x00000001
  227. #define INET_INFO_PRODUCT_NTWKSTA 0x00000002
  228. #define INET_INFO_PRODUCT_WINDOWS95 0x00000003
  229. #define INET_INFO_PRODUCT_UNKNOWN 0xffffffff
  230. //
  231. // Settable server capabilities
  232. //
  233. #define IIS_CAP1_ODBC_LOGGING 0x00000001
  234. #define IIS_CAP1_FILE_LOGGING 0x00000002
  235. #define IIS_CAP1_VIRTUAL_SERVER 0x00000004
  236. #define IIS_CAP1_BW_THROTTLING 0x00000008
  237. #define IIS_CAP1_IP_ACCESS_CHECK 0x00000010
  238. #define IIS_CAP1_MAX_CONNECTIONS 0x00000020
  239. #define IIS_CAP1_ALL ( IIS_CAP1_ODBC_LOGGING | \
  240. IIS_CAP1_FILE_LOGGING | \
  241. IIS_CAP1_VIRTUAL_SERVER | \
  242. IIS_CAP1_BW_THROTTLING | \
  243. IIS_CAP1_IP_ACCESS_CHECK | \
  244. IIS_CAP1_MAX_CONNECTIONS \
  245. )
  246. //
  247. // INet admin API Prototypes
  248. //
  249. NET_API_STATUS
  250. NET_API_FUNCTION
  251. InetInfoGetVersion(
  252. IN LPWSTR pszServer OPTIONAL,
  253. IN DWORD dwReserved,
  254. OUT DWORD * pdwVersion
  255. );
  256. NET_API_STATUS
  257. NET_API_FUNCTION
  258. InetInfoGetServerCapabilities(
  259. IN LPWSTR pszServer OPTIONAL,
  260. IN DWORD dwReserved,
  261. OUT LPINET_INFO_CAPABILITIES * ppCap
  262. );
  263. NET_API_STATUS
  264. NET_API_FUNCTION
  265. InetInfoGetGlobalAdminInformation(
  266. IN LPWSTR pszServer OPTIONAL,
  267. IN DWORD dwReserved,
  268. OUT LPINET_INFO_GLOBAL_CONFIG_INFO * ppConfig
  269. );
  270. NET_API_STATUS
  271. NET_API_FUNCTION
  272. InetInfoSetGlobalAdminInformation(
  273. IN LPWSTR pszServer OPTIONAL,
  274. IN DWORD dwReserved,
  275. IN INET_INFO_GLOBAL_CONFIG_INFO * pConfig
  276. );
  277. NET_API_STATUS
  278. NET_API_FUNCTION
  279. InetInfoGetAdminInformation(
  280. IN LPWSTR pszServer OPTIONAL,
  281. IN DWORD dwServerMask,
  282. OUT LPINET_INFO_CONFIG_INFO * ppConfig
  283. );
  284. NET_API_STATUS
  285. NET_API_FUNCTION
  286. InetInfoSetAdminInformation(
  287. IN LPWSTR pszServer OPTIONAL,
  288. IN DWORD dwServerMask,
  289. IN INET_INFO_CONFIG_INFO * pConfig
  290. );
  291. NET_API_STATUS
  292. NET_API_FUNCTION
  293. InetInfoQueryStatistics(
  294. IN LPWSTR pszServer OPTIONAL,
  295. IN DWORD Level,
  296. IN DWORD dwServerMask,
  297. OUT LPBYTE * Buffer
  298. );
  299. NET_API_STATUS
  300. NET_API_FUNCTION
  301. InetInfoClearStatistics(
  302. IN LPWSTR pszServer OPTIONAL,
  303. IN DWORD dwServerMask
  304. );
  305. NET_API_STATUS
  306. NET_API_FUNCTION
  307. InetInfoFlushMemoryCache(
  308. IN LPWSTR pszServer OPTIONAL,
  309. IN DWORD dwServerMask
  310. );
  311. /////////////////////////////////////////////////////////////////////////
  312. // //
  313. // HTTP (w3) specific items //
  314. // //
  315. /////////////////////////////////////////////////////////////////////////
  316. //
  317. // Client Interface Name for RPC connections over named pipes
  318. //
  319. #define W3_SERVICE_NAME TEXT("W3SVC")
  320. #define W3_SERVICE_NAME_A "W3SVC"
  321. #define W3_SERVICE_NAME_W L"W3SVC"
  322. # define W3_INTERFACE_NAME W3_SERVICE_NAME
  323. # define W3_NAMED_PIPE TEXT("\\PIPE\\") ## W3_INTERFACE_NAME
  324. # define W3_NAMED_PIPE_W L"\\PIPE\\" ## W3_SERVICE_NAME_W
  325. //
  326. // Manifests for APIs
  327. //
  328. #define FC_W3_DIR_BROWSE_CONTROL ((FIELD_CONTROL)BitFlag(0))
  329. #define FC_W3_DEFAULT_LOAD_FILE ((FIELD_CONTROL)BitFlag(1))
  330. #define FC_W3_CHECK_FOR_WAISDB ((FIELD_CONTROL)BitFlag(2))
  331. #define FC_W3_DIRECTORY_IMAGE ((FIELD_CONTROL)BitFlag(3))
  332. #define FC_W3_SERVER_AS_PROXY ((FIELD_CONTROL)BitFlag(4))
  333. #define FC_W3_CATAPULT_USER_AND_PWD ((FIELD_CONTROL)BitFlag(5))
  334. #define FC_W3_SSI_ENABLED ((FIELD_CONTROL)BitFlag(6))
  335. #define FC_W3_SSI_EXTENSION ((FIELD_CONTROL)BitFlag(7))
  336. #define FC_W3_GLOBAL_EXPIRE ((FIELD_CONTROL)BitFlag(8))
  337. #define FC_W3_SCRIPT_MAPPING ((FIELD_CONTROL)BitFlag(9))
  338. #define FC_W3_ALL (FC_W3_DIR_BROWSE_CONTROL | \
  339. FC_W3_DEFAULT_LOAD_FILE | \
  340. FC_W3_CHECK_FOR_WAISDB | \
  341. FC_W3_DIRECTORY_IMAGE | \
  342. FC_W3_SERVER_AS_PROXY | \
  343. FC_W3_CATAPULT_USER_AND_PWD |\
  344. FC_W3_SSI_ENABLED | \
  345. FC_W3_SSI_EXTENSION | \
  346. FC_W3_GLOBAL_EXPIRE | \
  347. FC_W3_SCRIPT_MAPPING)
  348. //
  349. // HTTP Directory browsing flags
  350. //
  351. #define DIRBROW_SHOW_ICON 0x00000001
  352. #define DIRBROW_SHOW_DATE 0x00000002
  353. #define DIRBROW_SHOW_TIME 0x00000004
  354. #define DIRBROW_SHOW_SIZE 0x00000008
  355. #define DIRBROW_SHOW_EXTENSION 0x00000010
  356. #define DIRBROW_LONG_DATE 0x00000020
  357. #define DIRBROW_ENABLED 0x80000000
  358. #define DIRBROW_LOADDEFAULT 0x40000000
  359. #define DIRBROW_MASK (DIRBROW_SHOW_ICON | \
  360. DIRBROW_SHOW_DATE | \
  361. DIRBROW_SHOW_TIME | \
  362. DIRBROW_SHOW_SIZE | \
  363. DIRBROW_SHOW_EXTENSION | \
  364. DIRBROW_LONG_DATE | \
  365. DIRBROW_LOADDEFAULT | \
  366. DIRBROW_ENABLED)
  367. //
  368. // Setting the csecGlobalExpire field to this value will prevent the server
  369. // from generating an "Expires:" header.
  370. //
  371. #define NO_GLOBAL_EXPIRE 0xffffffff
  372. //
  373. // Encryption Capabilities
  374. //
  375. #define ENC_CAPS_NOT_INSTALLED 0x80000000 // No keys installed
  376. #define ENC_CAPS_DISABLED 0x40000000 // Disabled due to locale
  377. #define ENC_CAPS_SSL 0x00000001 // SSL active
  378. #define ENC_CAPS_PCT 0x00000002 // PCT active
  379. //
  380. // Encryption type (SSL/PCT etc) portion of encryption flag dword
  381. //
  382. #define ENC_CAPS_TYPE_MASK (ENC_CAPS_SSL | \
  383. ENC_CAPS_PCT)
  384. #define ENC_CAPS_DEFAULT ENC_CAPS_TYPE_MASK
  385. //
  386. // Structures for APIs
  387. //
  388. typedef struct _W3_USER_INFO
  389. {
  390. DWORD idUser; // User id
  391. LPWSTR pszUser; // User name
  392. BOOL fAnonymous; // TRUE if the user is logged on as
  393. // Anonymous, FALSE otherwise
  394. DWORD inetHost; // Host Address
  395. DWORD tConnect; // User Connection Time (elapsed seconds)
  396. } W3_USER_INFO, * LPW3_USER_INFO;
  397. typedef struct _W3_STATISTICS_0
  398. {
  399. LARGE_INTEGER TotalBytesSent;
  400. LARGE_INTEGER TotalBytesReceived;
  401. DWORD TotalFilesSent;
  402. DWORD TotalFilesReceived;
  403. DWORD CurrentAnonymousUsers;
  404. DWORD CurrentNonAnonymousUsers;
  405. DWORD TotalAnonymousUsers;
  406. DWORD TotalNonAnonymousUsers;
  407. DWORD MaxAnonymousUsers;
  408. DWORD MaxNonAnonymousUsers;
  409. DWORD CurrentConnections;
  410. DWORD MaxConnections;
  411. DWORD ConnectionAttempts;
  412. DWORD LogonAttempts;
  413. DWORD TotalGets;
  414. DWORD TotalPosts;
  415. DWORD TotalHeads;
  416. DWORD TotalOthers; // Other HTTP verbs
  417. DWORD TotalCGIRequests;
  418. DWORD TotalBGIRequests;
  419. DWORD TotalNotFoundErrors;
  420. DWORD CurrentCGIRequests;
  421. DWORD CurrentBGIRequests;
  422. DWORD MaxCGIRequests;
  423. DWORD MaxBGIRequests;
  424. DWORD TimeOfLastClear;
  425. # ifndef NO_AUX_PERF
  426. DWORD nAuxCounters; // number of active counters in rgCounters
  427. DWORD rgCounters[MAX_AUX_PERF_COUNTERS];
  428. # endif // NO_AUX_PERF
  429. } W3_STATISTICS_0, * LPW3_STATISTICS_0;
  430. typedef struct _W3_SCRIPT_MAP_ENTRY
  431. {
  432. LPWSTR lpszExtension;
  433. LPWSTR lpszImage;
  434. } W3_SCRIPT_MAP_ENTRY, *LPW3_SCRIPT_MAP_ENTRY;
  435. typedef struct _W3_SCRIPT_MAP_LIST
  436. {
  437. DWORD cEntries;
  438. #ifdef MIDL_PASS
  439. [size_is( cEntries)]
  440. #endif
  441. W3_SCRIPT_MAP_ENTRY aScriptMap[];
  442. } W3_SCRIPT_MAP_LIST, *LPW3_SCRIPT_MAP_LIST;
  443. typedef struct _W3_CONFIG_INFO
  444. {
  445. FIELD_CONTROL FieldControl;
  446. DWORD dwDirBrowseControl; // Directory listing and def. load
  447. LPWSTR lpszDefaultLoadFile; // File to load if feature is on
  448. BOOL fCheckForWAISDB; // Call waislookup if .dct found?
  449. LPWSTR lpszDirectoryImage; // Image for directory in file list
  450. BOOL fServerAsProxy; // Run server as a proxy if TRUE
  451. LPWSTR lpszCatapultUser; // The user/password to impersonate
  452. WCHAR szCatapultUserPwd[PWLEN+1]; // if the proxy server is using
  453. // the catapult server
  454. BOOL fSSIEnabled; // Are server side includes enabled?
  455. LPWSTR lpszSSIExtension; // Extension for server side inc.
  456. DWORD csecGlobalExpire; // Value to set Expires: header to
  457. LPW3_SCRIPT_MAP_LIST ScriptMap; // List of extension mappings
  458. DWORD dwEncCaps; // Encryption capabilities
  459. } W3_CONFIG_INFO, *LPW3_CONFIG_INFO;
  460. //
  461. // API Prototypes
  462. //
  463. NET_API_STATUS
  464. NET_API_FUNCTION
  465. W3GetAdminInformation(
  466. IN LPWSTR pszServer OPTIONAL,
  467. OUT LPW3_CONFIG_INFO * ppConfig
  468. );
  469. NET_API_STATUS
  470. NET_API_FUNCTION
  471. W3SetAdminInformation(
  472. IN LPWSTR pszServer OPTIONAL,
  473. IN LPW3_CONFIG_INFO pConfig
  474. );
  475. NET_API_STATUS
  476. NET_API_FUNCTION
  477. W3EnumerateUsers(
  478. IN LPWSTR pszServer OPTIONAL,
  479. OUT LPDWORD lpdwEntriesRead,
  480. OUT LPW3_USER_INFO * Buffer
  481. );
  482. NET_API_STATUS
  483. NET_API_FUNCTION
  484. W3DisconnectUser(
  485. IN LPWSTR pszServer OPTIONAL,
  486. IN DWORD idUser
  487. );
  488. NET_API_STATUS
  489. NET_API_FUNCTION
  490. W3QueryStatistics(
  491. IN LPWSTR pszServer OPTIONAL,
  492. IN DWORD Level,
  493. OUT LPBYTE * Buffer
  494. );
  495. NET_API_STATUS
  496. NET_API_FUNCTION
  497. W3ClearStatistics(
  498. IN LPWSTR pszServer OPTIONAL
  499. );
  500. /////////////////////////////////////////////////////////////////////////
  501. // //
  502. // FTP specific items //
  503. // //
  504. /////////////////////////////////////////////////////////////////////////
  505. //
  506. // Service name.
  507. //
  508. //#define FTPD_SERVICE_NAME TEXT("MSFTPSVC")
  509. //#define FTPD_SERVICE_NAME_A "MSFTPSVC"
  510. //#define FTPD_SERVICE_NAME_W L"MSFTPSVC"
  511. //
  512. // Client Interface Name for RPC connections over named pipes
  513. //
  514. # define FTP_INTERFACE_NAME FTPD_SERVICE_NAME
  515. # define FTP_NAMED_PIPE TEXT("\\PIPE\\") ## FTP_INTERFACE_NAME
  516. # define FTP_NAMED_PIPE_W L"\\PIPE\\" ## FTPD_SERVICE_NAME_W
  517. //
  518. // Manifests for APIs.
  519. //
  520. #define FC_FTP_ALLOW_ANONYMOUS ((FIELD_CONTROL)BitFlag( 0))
  521. #define FC_FTP_ALLOW_GUEST_ACCESS ((FIELD_CONTROL)BitFlag( 1))
  522. #define FC_FTP_ANNOTATE_DIRECTORIES ((FIELD_CONTROL)BitFlag( 2))
  523. #define FC_FTP_ANONYMOUS_ONLY ((FIELD_CONTROL)BitFlag( 3))
  524. #define FC_FTP_EXIT_MESSAGE ((FIELD_CONTROL)BitFlag( 4))
  525. #define FC_FTP_GREETING_MESSAGE ((FIELD_CONTROL)BitFlag( 5))
  526. #define FC_FTP_HOME_DIRECTORY ((FIELD_CONTROL)BitFlag( 6))
  527. #define FC_FTP_LISTEN_BACKLOG ((FIELD_CONTROL)BitFlag( 7))
  528. #define FC_FTP_LOWERCASE_FILES ((FIELD_CONTROL)BitFlag( 8))
  529. #define FC_FTP_MAX_CLIENTS_MESSAGE ((FIELD_CONTROL)BitFlag( 9))
  530. #define FC_FTP_MSDOS_DIR_OUTPUT ((FIELD_CONTROL)BitFlag(10))
  531. #define FC_FTP_READ_ACCESS_MASK ((FIELD_CONTROL)BitFlag(11))
  532. #define FC_FTP_WRITE_ACCESS_MASK ((FIELD_CONTROL)BitFlag(12))
  533. #define FC_FTP_ALL ( \
  534. FC_FTP_ALLOW_ANONYMOUS | \
  535. FC_FTP_ALLOW_GUEST_ACCESS | \
  536. FC_FTP_ANNOTATE_DIRECTORIES | \
  537. FC_FTP_ANONYMOUS_ONLY | \
  538. FC_FTP_EXIT_MESSAGE | \
  539. FC_FTP_GREETING_MESSAGE | \
  540. FC_FTP_HOME_DIRECTORY | \
  541. FC_FTP_LISTEN_BACKLOG | \
  542. FC_FTP_LOWERCASE_FILES | \
  543. FC_FTP_MAX_CLIENTS_MESSAGE | \
  544. FC_FTP_MSDOS_DIR_OUTPUT | \
  545. FC_FTP_READ_ACCESS_MASK | \
  546. FC_FTP_WRITE_ACCESS_MASK | \
  547. 0 )
  548. //
  549. // Structures for APIs.
  550. //
  551. typedef struct _FTP_CONFIG_INFO
  552. {
  553. FIELD_CONTROL FieldControl;
  554. BOOL fAllowAnonymous;
  555. BOOL fAllowGuestAccess;
  556. BOOL fAnnotateDirectories;
  557. BOOL fAnonymousOnly;
  558. LPWSTR lpszExitMessage;
  559. LPWSTR lpszGreetingMessage;
  560. LPWSTR lpszHomeDirectory;
  561. DWORD dwListenBacklog;
  562. BOOL fLowercaseFiles;
  563. LPWSTR lpszMaxClientsMessage;
  564. BOOL fMsdosDirOutput;
  565. } FTP_CONFIG_INFO, * LPFTP_CONFIG_INFO;
  566. //
  567. // API Prototypes.
  568. //
  569. NET_API_STATUS
  570. NET_API_FUNCTION
  571. FtpGetAdminInformation(
  572. IN LPWSTR pszServer OPTIONAL,
  573. OUT LPFTP_CONFIG_INFO * ppConfig
  574. );
  575. NET_API_STATUS
  576. NET_API_FUNCTION
  577. FtpSetAdminInformation(
  578. IN LPWSTR pszServer OPTIONAL,
  579. IN LPFTP_CONFIG_INFO pConfig
  580. );
  581. # include <ftpd.h>
  582. /////////////////////////////////////////////////////////////////////////
  583. // //
  584. // Gopher specific items //
  585. // //
  586. /////////////////////////////////////////////////////////////////////////
  587. //
  588. // Service name.
  589. //
  590. # define GOPHERD_SERVICE_NAME TEXT("GopherSvc")
  591. # define GOPHERD_SERVICE_NAME_A "GopherSvc"
  592. # define GOPHERD_SERVICE_NAME_W L"GopherSvc"
  593. //
  594. // Client Interface Name for RPC connections over named pipes
  595. //
  596. # define GOPHERD_INTERFACE_NAME GOPHERD_SERVICE_NAME
  597. # define GOPHERD_NAMED_PIPE TEXT("\\PIPE\\") ## GOPHERD_INTERFACE_NAME
  598. # define GOPHERD_NAMED_PIPE_W L"\\PIPE\\" ## GOPHERD_SERVICE_NAME_W
  599. /************************************************************
  600. * Symbolic Constants
  601. * Prefix GDA_ stands for Gopher Daemon Admin
  602. ************************************************************/
  603. # define GDA_SITE ((FIELD_CONTROL ) BitFlag( 1)) // SZ
  604. # define GDA_ORGANIZATION ((FIELD_CONTROL ) BitFlag( 2)) // SZ
  605. # define GDA_LOCATION ((FIELD_CONTROL ) BitFlag( 3)) // SZ
  606. # define GDA_GEOGRAPHY ((FIELD_CONTROL ) BitFlag( 4)) // SZ
  607. # define GDA_LANGUAGE ((FIELD_CONTROL ) BitFlag( 5)) // SZ
  608. # define GDA_CHECK_FOR_WAISDB ((FIELD_CONTROL ) BitFlag( 8)) // BOOL
  609. # define GDA_DEBUG_FLAGS ((FIELD_CONTROL ) BitFlag( 30)) // DWORD
  610. # define GDA_ALL_CONFIG_INFO ( GDA_SITE | \
  611. GDA_ORGANIZATION | \
  612. GDA_LOCATION | \
  613. GDA_GEOGRAPHY | \
  614. GDA_LANGUAGE | \
  615. GDA_CHECK_FOR_WAISDB | \
  616. GDA_DEBUG_FLAGS \
  617. )
  618. # define GOPHERD_ANONYMOUS_SECRET_W L"GOPHERD_ANONYMOUS_DATA"
  619. # define GOPHERD_ROOT_SECRET_W L"GOPHERD_ROOT_DATA"
  620. //
  621. // Configuration information is the config data that is communicated
  622. // b/w the server and admin UI
  623. //
  624. typedef struct _GOPHERD_CONFIG_INFO {
  625. FIELD_CONTROL FieldControl; // bit mask indicating fields set.
  626. LPWSTR lpszSite; // Name of Gopher site
  627. LPWSTR lpszOrganization; // Organization Name
  628. LPWSTR lpszLocation; // Location of server
  629. LPWSTR lpszGeography; // Geographical data
  630. LPWSTR lpszLanguage; // Language for server
  631. BOOL fCheckForWaisDb; // Check & allow Wais Db
  632. // Debugging data
  633. DWORD dwDebugFlags; // Bitmap of debugging data
  634. } GOPHERD_CONFIG_INFO, * LPGOPHERD_CONFIG_INFO;
  635. typedef struct _GOPHERD_STATISTICS_INFO {
  636. LARGE_INTEGER TotalBytesSent;
  637. LARGE_INTEGER TotalBytesRecvd;
  638. DWORD TotalFilesSent;
  639. DWORD TotalDirectoryListings;
  640. DWORD TotalSearches;
  641. DWORD CurrentAnonymousUsers;
  642. DWORD CurrentNonAnonymousUsers;
  643. DWORD MaxAnonymousUsers;
  644. DWORD MaxNonAnonymousUsers;
  645. DWORD TotalAnonymousUsers;
  646. DWORD TotalNonAnonymousUsers;
  647. DWORD TotalConnections;
  648. DWORD MaxConnections;
  649. DWORD CurrentConnections;
  650. DWORD ConnectionAttempts; // raw connections made
  651. DWORD LogonAttempts; // total logons attempted
  652. DWORD AbortedAttempts; // Aborted connections
  653. DWORD ErroredConnections; // # in Error when processed
  654. DWORD GopherPlusRequests;
  655. DWORD TimeOfLastClear;
  656. } GOPHERD_STATISTICS_INFO, * LPGOPHERD_STATISTICS_INFO;
  657. //
  658. // GOPHERD_USER_INFO contains details about connected users.
  659. // This structure may undergo modification. Currently UserInformation
  660. // is not supported.
  661. //
  662. typedef struct _GOPHERD_USER_INFO {
  663. DWORD dwIdUser; // Id for user
  664. LPWSTR lpszUserName; // User name
  665. BOOL fAnonymous; // TRUE if user logged on as anonymous
  666. // FALSE otherwise
  667. DWORD dwInetHost; // host address for client
  668. //
  669. // Other details if required
  670. //
  671. } GOPHERD_USER_INFO, * LPGOPHERD_USER_INFO;
  672. /************************************************************
  673. * Gopher Server RPC APIs
  674. ************************************************************/
  675. //
  676. // Server Administrative Information
  677. //
  678. DWORD
  679. NET_API_FUNCTION
  680. GdGetAdminInformation(
  681. IN LPWSTR pszServer OPTIONAL,
  682. OUT LPGOPHERD_CONFIG_INFO * ppConfigInfo
  683. );
  684. DWORD
  685. NET_API_FUNCTION
  686. GdSetAdminInformation(
  687. IN LPWSTR pszServer OPTIONAL,
  688. IN LPGOPHERD_CONFIG_INFO pConfigInfo
  689. );
  690. //
  691. // API for Users enumeration ( Not Yet Supported).
  692. //
  693. DWORD
  694. NET_API_FUNCTION
  695. GdEnumerateUsers(
  696. IN LPWSTR pszServer OPTIONAL,
  697. OUT LPDWORD lpnEntriesRead,
  698. OUT LPGOPHERD_USER_INFO * lpUserBuffer
  699. );
  700. DWORD
  701. NET_API_FUNCTION
  702. GdDisconnectUser(
  703. IN LPWSTR pszServer OPTIONAL,
  704. IN DWORD dwIdUser
  705. );
  706. //
  707. // Statistics API
  708. //
  709. DWORD
  710. NET_API_FUNCTION
  711. GdGetStatistics(
  712. IN LPWSTR pszServer OPTIONAL,
  713. OUT LPBYTE lpStatBuffer // pass LPGOPHERD_STATISTICS_INFO
  714. );
  715. DWORD
  716. NET_API_FUNCTION
  717. GdClearStatistics(
  718. IN LPWSTR pszServer OPTIONAL
  719. );
  720. /////////////////////////////////////////////////////////////////////////
  721. // //
  722. // NNTP specific items //
  723. // //
  724. /////////////////////////////////////////////////////////////////////////
  725. //
  726. // Service name.
  727. //
  728. # define NNTP_SERVICE_NAME TEXT("NNTPSVC")
  729. # define NNTP_SERVICE_NAME_A "NNTPSVC"
  730. # define NNTP_SERVICE_NAME_W L"NNTPSVC"
  731. //
  732. // Client Interface Name for RPC connections over named pipes
  733. //
  734. # define NNTP_INTERFACE_NAME NNTP_SERVICE_NAME
  735. # define NNTP_NAMED_PIPE TEXT("\\PIPE\\") ## NNTP_INTERFACE_NAME
  736. # define NNTP_NAMED_PIPE_W L"\\PIPE\\" ## NNTP_SERVICE_NAME_W
  737. /////////////////////////////////////////////////////////////////////////
  738. // //
  739. // SMTP specific items //
  740. // //
  741. /////////////////////////////////////////////////////////////////////////
  742. //
  743. // Service name.
  744. //
  745. # define SMTP_SERVICE_NAME TEXT("SMTPSVC")
  746. # define SMTP_SERVICE_NAME_A "SMTPSVC"
  747. # define SMTP_SERVICE_NAME_W L"SMTPSVC"
  748. //
  749. // Client Interface Name for RPC connections over named pipes
  750. //
  751. # define SMTP_INTERFACE_NAME SMTP_SERVICE_NAME
  752. # define SMTP_NAMED_PIPE TEXT("\\PIPE\\") ## SMTP_INTERFACE_NAME
  753. # define SMTP_NAMED_PIPE_W L"\\PIPE\\" ## SMTP_SERVICE_NAME_W
  754. /////////////////////////////////////////////////////////////////////////
  755. // //
  756. // POP3 specific items //
  757. // //
  758. /////////////////////////////////////////////////////////////////////////
  759. //
  760. // Service name.
  761. //
  762. # define POP3_SERVICE_NAME TEXT("POP3SVC")
  763. # define POP3_SERVICE_NAME_A "POP3SVC"
  764. # define POP3_SERVICE_NAME_W L"POP3SVC"
  765. //
  766. // Client Interface Name for RPC connections over named pipes
  767. //
  768. # define POP3_INTERFACE_NAME POP3_SERVICE_NAME
  769. # define POP3_NAMED_PIPE TEXT("\\PIPE\\") ## POP3_INTERFACE_NAME
  770. # define POP3_NAMED_PIPE_W L"\\PIPE\\" ## POP3_SERVICE_NAME_W
  771. /////////////////////////////////////////////////////////////////////////
  772. // //
  773. // Catapult specific items //
  774. // //
  775. /////////////////////////////////////////////////////////////////////////
  776. # define INET_GATEWAY_INTERFACE_NAME TEXT("gateway")
  777. // preserve back ward compatibility
  778. typedef INET_INFO_CONFIG_INFO INETA_CONFIG_INFO,
  779. * LPINETA_CONFIG_INFO;
  780. typedef INET_INFO_IP_SEC_ENTRY INETA_IP_SEC_ENTRY,
  781. * LPINETA_IP_SEC_ENTRY;
  782. typedef INET_INFO_IP_SEC_LIST INETA_IP_SEC_LIST,
  783. * LPINETA_IP_SEC_LIST;
  784. typedef INET_INFO_VIRTUAL_ROOT_ENTRY INETA_VIRTUAL_ROOT_ENTRY,
  785. * LPINETA_VIRTUAL_ROOT_ENTRY;
  786. typedef INET_INFO_VIRTUAL_ROOT_LIST INETA_VIRTUAL_ROOT_LIST,
  787. * LPINETA_VIRTUAL_ROOT_LIST;
  788. typedef INET_INFO_GLOBAL_CONFIG_INFO INETA_GLOBAL_CONFIG_INFO,
  789. * LPINETA_GLOBAL_CONFIG_INFO;
  790. typedef INET_INFO_STATISTICS_0 INETA_STATISTICS_0,
  791. * LPINETA_STATISTICS_0;
  792. # define INETA_PARAMETERS_KEY (INET_INFO_PARAMETERS_KEY)
  793. /////////////////////////////////////////////////////////////////////////
  794. // //
  795. // CHAT specific items //
  796. // //
  797. /////////////////////////////////////////////////////////////////////////
  798. //
  799. // Service name.
  800. //
  801. # define CHAT_SERVICE_NAME TEXT("ChatSvc")
  802. # define CHAT_SERVICE_NAME_A "ChatSvc"
  803. # define CHAT_SERVICE_NAME_W L"ChatSvc"
  804. //
  805. // Client Interface Name for RPC connections over named pipes
  806. //
  807. # define CHAT_INTERFACE_NAME CHAT_SERVICE_NAME
  808. # define CHAT_NAMED_PIPE TEXT("\\PIPE\\") ## CHAT_INTERFACE_NAME
  809. # define CHAT_NAMED_PIPE_W L"\\PIPE\\" ## CHAT_SERVICE_NAME_W
  810. //
  811. // Manifests for APIs.
  812. //
  813. #define FC_CHAT_ALLOW_ANONYMOUS ((FIELD_CONTROL)BitFlag( 0))
  814. #define FC_CHAT_ALLOW_GUEST_ACCESS ((FIELD_CONTROL)BitFlag( 1))
  815. #define FC_CHAT_ANNOTATE_DIRECTORIES ((FIELD_CONTROL)BitFlag( 2))
  816. #define FC_CHAT_ANONYMOUS_ONLY ((FIELD_CONTROL)BitFlag( 3))
  817. #define FC_CHAT_EXIT_MESSAGE ((FIELD_CONTROL)BitFlag( 4))
  818. #define FC_CHAT_GREETING_MESSAGE ((FIELD_CONTROL)BitFlag( 5))
  819. #define FC_CHAT_HOME_DIRECTORY ((FIELD_CONTROL)BitFlag( 6))
  820. #define FC_CHAT_LISTEN_BACKLOG ((FIELD_CONTROL)BitFlag( 7))
  821. #define FC_CHAT_LOWERCASE_FILES ((FIELD_CONTROL)BitFlag( 8))
  822. #define FC_CHAT_MAX_CLIENTS_MESSAGE ((FIELD_CONTROL)BitFlag( 9))
  823. #define FC_CHAT_MSDOS_DIR_OUTPUT ((FIELD_CONTROL)BitFlag(10))
  824. #define FC_CHAT_READ_ACCESS_MASK ((FIELD_CONTROL)BitFlag(11))
  825. #define FC_CHAT_WRITE_ACCESS_MASK ((FIELD_CONTROL)BitFlag(12))
  826. #define FC_CHAT_ALL ( \
  827. FC_CHAT_ALLOW_ANONYMOUS | \
  828. FC_CHAT_ALLOW_GUEST_ACCESS | \
  829. FC_CHAT_ANNOTATE_DIRECTORIES | \
  830. FC_CHAT_ANONYMOUS_ONLY | \
  831. FC_CHAT_EXIT_MESSAGE | \
  832. FC_CHAT_GREETING_MESSAGE | \
  833. FC_CHAT_HOME_DIRECTORY | \
  834. FC_CHAT_LISTEN_BACKLOG | \
  835. FC_CHAT_LOWERCASE_FILES | \
  836. FC_CHAT_MAX_CLIENTS_MESSAGE | \
  837. FC_CHAT_MSDOS_DIR_OUTPUT | \
  838. FC_CHAT_READ_ACCESS_MASK | \
  839. FC_CHAT_WRITE_ACCESS_MASK | \
  840. 0 )
  841. //
  842. // Structures for APIs.
  843. //
  844. typedef struct _CHAT_CONFIG_INFO
  845. {
  846. FIELD_CONTROL FieldControl;
  847. BOOL fAllowAnonymous;
  848. BOOL fAllowGuestAccess;
  849. BOOL fAnnotateDirectories;
  850. BOOL fAnonymousOnly;
  851. LPWSTR lpszExitMessage;
  852. LPWSTR lpszGreetingMessage;
  853. LPWSTR lpszHomeDirectory;
  854. DWORD dwListenBacklog;
  855. BOOL fLowercaseFiles;
  856. LPWSTR lpszMaxClientsMessage;
  857. BOOL fMsdosDirOutput;
  858. } CHAT_CONFIG_INFO, * LPCHAT_CONFIG_INFO;
  859. //
  860. // API Prototypes.
  861. //
  862. NET_API_STATUS
  863. NET_API_FUNCTION
  864. ChatGetAdminInformation(
  865. IN LPWSTR pszServer OPTIONAL,
  866. OUT LPCHAT_CONFIG_INFO * ppConfig
  867. );
  868. NET_API_STATUS
  869. NET_API_FUNCTION
  870. ChatSetAdminInformation(
  871. IN LPWSTR pszServer OPTIONAL,
  872. IN LPCHAT_CONFIG_INFO pConfig
  873. );
  874. # include <chat.h>
  875. #ifdef __cplusplus
  876. }
  877. #endif // _cplusplus
  878. #endif // _INETINFO_H_
  879.