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.

926 lines
33 KiB

  1. /*
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. macfile.h
  5. Abstract:
  6. This module contains data structures, related constants and functions,
  7. error retuen codes and prototypes of AfpAdminxxx APIs. This file should
  8. be included by any application that will administer the MACFILE service.
  9. Author:
  10. Narendra Gidwani (microsoft!nareng)
  11. Revision History:
  12. 12 Jume 1992 NarenG Initial version. Split admin.h into admin.h
  13. and macfile.h.
  14. --*/
  15. #ifndef _MACFILE_
  16. #define _MACFILE_
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif
  20. // Used as RPC binding handle to server
  21. typedef ULONG_PTR AFP_SERVER_HANDLE;
  22. typedef ULONG_PTR *PAFP_SERVER_HANDLE;
  23. #define AFP_SERVICE_NAME TEXT("MacFile")
  24. // Error return values from AfpAdminxxx Api's
  25. // WARNING! If you change any any codes below, please change
  26. // afpmgr.h accoringly.
  27. #define AFPERR_BASE -6000
  28. #define AFPERR_InvalidVolumeName (AFPERR_BASE-1)
  29. #define AFPERR_InvalidId (AFPERR_BASE-2)
  30. #define AFPERR_InvalidParms (AFPERR_BASE-3)
  31. #define AFPERR_CodePage (AFPERR_BASE-4)
  32. #define AFPERR_InvalidServerName (AFPERR_BASE-5)
  33. #define AFPERR_DuplicateVolume (AFPERR_BASE-6)
  34. #define AFPERR_VolumeBusy (AFPERR_BASE-7)
  35. #define AFPERR_VolumeReadOnly (AFPERR_BASE-8)
  36. #define AFPERR_DirectoryNotInVolume (AFPERR_BASE-9)
  37. #define AFPERR_SecurityNotSupported (AFPERR_BASE-10)
  38. #define AFPERR_BufferSize (AFPERR_BASE-11)
  39. #define AFPERR_DuplicateExtension (AFPERR_BASE-12)
  40. #define AFPERR_UnsupportedFS (AFPERR_BASE-13)
  41. #define AFPERR_InvalidSessionType (AFPERR_BASE-14)
  42. #define AFPERR_InvalidServerState (AFPERR_BASE-15)
  43. #define AFPERR_NestedVolume (AFPERR_BASE-16)
  44. #define AFPERR_InvalidComputername (AFPERR_BASE-17)
  45. #define AFPERR_DuplicateTypeCreator (AFPERR_BASE-18)
  46. #define AFPERR_TypeCreatorNotExistant (AFPERR_BASE-19)
  47. #define AFPERR_CannotDeleteDefaultTC (AFPERR_BASE-20)
  48. #define AFPERR_CannotEditDefaultTC (AFPERR_BASE-21)
  49. #define AFPERR_InvalidTypeCreator (AFPERR_BASE-22)
  50. #define AFPERR_InvalidExtension (AFPERR_BASE-23)
  51. #define AFPERR_TooManyEtcMaps (AFPERR_BASE-24)
  52. #define AFPERR_InvalidPassword (AFPERR_BASE-25)
  53. #define AFPERR_VolumeNonExist (AFPERR_BASE-26)
  54. #define AFPERR_NoSuchUserGroup (AFPERR_BASE-27)
  55. #define AFPERR_NoSuchUser (AFPERR_BASE-28)
  56. #define AFPERR_NoSuchGroup (AFPERR_BASE-29)
  57. #define AFPERR_InvalidParms_LoginMsg (AFPERR_BASE-30)
  58. #define AFPERR_InvalidParms_MaxVolUses (AFPERR_BASE-31)
  59. #define AFPERR_InvalidParms_MaxSessions (AFPERR_BASE-32)
  60. #define AFPERR_InvalidServerName_Length (AFPERR_BASE-33)
  61. #define AFPERR_MIN AFPERR_InvalidServerName_Length
  62. // Constants related to the following data strucutures.
  63. #define AFP_SERVERNAME_LEN 31
  64. #define AFP_VOLNAME_LEN 27
  65. #define AFP_VOLPASS_LEN 8
  66. #define AFP_WKSTANAME_LEN 65
  67. #define AFP_EXTENSION_LEN 3
  68. #define AFP_CREATOR_LEN 4
  69. #define AFP_TYPE_LEN 4
  70. #define AFP_MESSAGE_LEN 199
  71. #define AFP_MAXICONSIZE 2048
  72. #define AFP_MAXSESSIONS 0XFFFFFFFF
  73. #define AFP_ETC_COMMENT_LEN 36
  74. // Relative paths to registry keys that contain information for the macfile
  75. // server.
  76. #define AFP_KEYPATH_SERVER_PARAMS \
  77. TEXT("SYSTEM\\CurrentControlSet\\Services\\MacFile\\PARAMETERS")
  78. #define AFP_KEYPATH_VOLUMES \
  79. TEXT("SYSTEM\\CurrentControlSet\\Services\\MacFile\\PARAMETERS\\VOLUMES")
  80. #define AFP_KEYPATH_TYPE_CREATORS \
  81. TEXT("SYSTEM\\CurrentControlSet\\Services\\MacFile\\PARAMETERS\\TYPE_CREATORS")
  82. #define AFP_KEYPATH_EXTENSIONS \
  83. TEXT("SYSTEM\\CurrentControlSet\\Services\\MacFile\\PARAMETERS\\EXTENSIONS")
  84. #define AFP_KEYPATH_ICONS \
  85. TEXT("SYSTEM\\CurrentControlSet\\Services\\MacFile\\PARAMETERS\\ICONS")
  86. #define AFP_KEYPATH_CODEPAGE \
  87. TEXT("SYSTEM\\CurrentControlSet\\Control\\Nls\\Codepage")
  88. // Value names for server parameters
  89. #define AFPREG_VALNAME_SVRNAME TEXT("ServerName")
  90. #define AFPREG_VALNAME_SRVOPTIONS TEXT("ServerOptions")
  91. #define AFPREG_VALNAME_MAXSESSIONS TEXT("MaxSessions")
  92. #define AFPREG_VALNAME_LOGINMSG TEXT("LoginMsg")
  93. #define AFPREG_VALNAME_MAXPAGEDMEM TEXT("PagedMemLimit")
  94. #define AFPREG_VALNAME_MAXNONPAGEDMEM TEXT("NonPagedMemLimit")
  95. #define AFPREG_VALNAME_TYPE TEXT("Type")
  96. #define AFPREG_VALNAME_CREATOR TEXT("Creator")
  97. #define AFPREG_VALNAME_COMMENT TEXT("Comment")
  98. #define AFPREG_VALNAME_PASSWORD TEXT("Password")
  99. #define AFPREG_VALNAME_MAXUSES TEXT("MaxUses")
  100. #define AFPREG_VALNAME_PROPS TEXT("Properties")
  101. #define AFPREG_VALNAME_PATH TEXT("Path")
  102. #define AFPREG_VALNAME_ID TEXT("Id")
  103. #define AFPREG_VALNAME_ICONTYPE TEXT("IconType")
  104. #define AFPREG_VALNAME_DATA TEXT("Data")
  105. #define AFPREG_VALNAME_LENGTH TEXT("Length")
  106. #define AFPREG_VALNAME_CODEPAGE TEXT("MACCP")
  107. #define AFPREG_VALNAME_CATSEARCH TEXT("DisableCatsearch")
  108. // Limits on server parameters
  109. #define AFP_MAX_ALLOWED_SRV_SESSIONS AFP_MAXSESSIONS
  110. #define AFP_MIN_ALLOWED_PAGED_MEM 1000
  111. #define AFP_MAX_ALLOWED_PAGED_MEM 256000
  112. #define AFP_MIN_ALLOWED_NONPAGED_MEM 256
  113. #define AFP_MAX_ALLOWED_NONPAGED_MEM 16000
  114. // Server default parameter values
  115. #define AFP_DEF_SRVOPTIONS (AFP_SRVROPT_GUESTLOGONALLOWED)
  116. #define AFP_DEF_MAXSESSIONS AFP_MAXSESSIONS
  117. #define AFP_DEF_TYPE TEXT("TEXT")
  118. #define AFP_DEF_CREATOR TEXT("LMAN")
  119. #define AFP_DEF_EXTENSION_W L"*"
  120. #define AFP_DEF_EXTENSION_A "*"
  121. #define AFP_DEF_TCID 0
  122. #define AFP_DEF_MAXPAGEDMEM 20000
  123. #define AFP_DEF_MAXNONPAGEDMEM 4000
  124. #define AFP_DEF_CODEPAGE_PATH TEXT("C:\\NT\\SYSTEM32\\C_10000.NLS")
  125. // Will be concatenated to the system path to form source path of volume icon
  126. #define AFP_DEF_VOLICON_SRCNAME TEXT("\\SFMICON.VOL")
  127. // Server options
  128. #define AFP_SRVROPT_NONE 0x0000
  129. #define AFP_SRVROPT_GUESTLOGONALLOWED 0x0001
  130. #define AFP_SRVROPT_CLEARTEXTLOGONALLOWED 0x0002
  131. #define AFP_SRVROPT_ALLOWSAVEDPASSWORD 0x0004
  132. #define AFP_SRVROPT_STANDALONE 0x0008
  133. #define AFP_SRVROPT_4GB_VOLUMES 0x0010
  134. #define AFP_SRVROPT_MICROSOFT_UAM 0x0020
  135. #define AFP_SRVROPT_NATIVEAPPLEUAM 0x0040
  136. #define AFP_SRVROPT_ALL ( AFP_SRVROPT_GUESTLOGONALLOWED \
  137. | AFP_SRVROPT_CLEARTEXTLOGONALLOWED \
  138. | AFP_SRVROPT_ALLOWSAVEDPASSWORD \
  139. | AFP_SRVROPT_4GB_VOLUMES \
  140. | AFP_SRVROPT_MICROSOFT_UAM \
  141. | AFP_SRVROPT_NATIVEAPPLEUAM \
  142. | AFP_SRVROPT_STANDALONE )
  143. // AFP Service default parameters
  144. #define AFP_SERVER_PARMNUM_LOGINMSG 0x00000001
  145. #define AFP_SERVER_PARMNUM_MAX_SESSIONS 0x00000002
  146. #define AFP_SERVER_PARMNUM_OPTIONS 0x00000004
  147. #define AFP_SERVER_PARMNUM_NAME 0x00000008
  148. #define AFP_SERVER_PARMNUM_PAGEMEMLIM 0x00000010
  149. #define AFP_SERVER_PARMNUM_NONPAGEMEMLIM 0x00000020
  150. #define AFP_SERVER_PARMNUM_CODEPAGE 0x00000040
  151. #define AFP_SERVER_GUEST_ACCT_NOTIFY 0x00000080
  152. #define AFP_SERVER_PARMNUM_ALL ( AFP_SERVER_PARMNUM_LOGINMSG \
  153. | AFP_SERVER_PARMNUM_MAX_SESSIONS \
  154. | AFP_SERVER_PARMNUM_OPTIONS \
  155. | AFP_SERVER_PARMNUM_NAME \
  156. | AFP_SERVER_PARMNUM_PAGEMEMLIM \
  157. | AFP_SERVER_PARMNUM_NONPAGEMEMLIM \
  158. | AFP_SERVER_PARMNUM_CODEPAGE \
  159. | AFP_SERVER_GUEST_ACCT_NOTIFY)
  160. typedef struct _AFP_SERVER_INFO
  161. {
  162. LPWSTR afpsrv_name; // Macintosh name of the server
  163. // max. AFP_SERVERNAME_LEN.
  164. DWORD afpsrv_max_sessions; // Maximum simultaneous sessions
  165. // In the range 1 - AFP_MAXSESSIONS.
  166. // 0 is invalid
  167. DWORD afpsrv_options; // Server Options
  168. DWORD afpsrv_max_paged_mem; // Cap on paged memory usage
  169. DWORD afpsrv_max_nonpaged_mem;// Cap on paged memory usage
  170. LPWSTR afpsrv_login_msg; // NULL terminated UNICODE string.
  171. // MAX AFP_MESSAGE_LEN chars.
  172. // NULL => no login msg.
  173. LPWSTR afpsrv_codepage; // NULL terminated UNICODE path
  174. // NULL => no codepage path.
  175. } AFP_SERVER_INFO, *PAFP_SERVER_INFO;
  176. // Volume properties mask values. Values may be or'ed together.
  177. // Volume flags with msk 0x0000001F are defined by the AFP specification.
  178. // Do not overload these. Most of these values (except for READONLY above)
  179. // are not exposed via admin apis.
  180. #define AFP_VOLUME_READONLY 0x00000001
  181. #define AFP_VOLUME_GUESTACCESS 0x00008000
  182. #define AFP_VOLUME_EXCLUSIVE 0x00010000
  183. #define AFP_VOLUME_HAS_CUSTOM_ICON 0x00020000
  184. #define AFP_VOLUME_4GB 0x00040000
  185. #define AFP_VOLUME_AGE_DFES 0x00080000
  186. #define AFP_VOLUME_DISALLOW_CATSRCH 0x00100000
  187. #define AFP_VOLUME_ALL_DOWNLEVEL (AFP_VOLUME_READONLY | \
  188. AFP_VOLUME_GUESTACCESS)
  189. #define AFP_VOLUME_ALL (AFP_VOLUME_READONLY | \
  190. AFP_VOLUME_GUESTACCESS | \
  191. AFP_VOLUME_EXCLUSIVE | \
  192. AFP_VOLUME_HAS_CUSTOM_ICON | \
  193. AFP_VOLUME_4GB | \
  194. AFP_VOLUME_DISALLOW_CATSRCH | \
  195. AFP_VOLUME_AGE_DFES)
  196. #define AFP_VOLUME_UNLIMITED_USES 0xFFFFFFFF
  197. // The following bits define the fields within the AFP_VOLUME_INFO
  198. // structure whose values will be set.
  199. //
  200. #define AFP_VOL_PARMNUM_MAXUSES 0x00000002
  201. #define AFP_VOL_PARMNUM_PROPSMASK 0x00000004
  202. #define AFP_VOL_PARMNUM_PASSWORD 0x00000001
  203. #define AFP_VOL_PARMNUM_ALL ( AFP_VOL_PARMNUM_PASSWORD \
  204. | AFP_VOL_PARMNUM_MAXUSES \
  205. | AFP_VOL_PARMNUM_PROPSMASK )
  206. typedef struct _AFP_VOLUME_INFO
  207. {
  208. LPWSTR afpvol_name; // Name of the volume max.
  209. DWORD afpvol_id; // id of this volume. generated by sever
  210. LPWSTR afpvol_password; // Volume password, max. AFP_VOLPASS_LEN
  211. DWORD afpvol_max_uses; // Max opens allowed
  212. DWORD afpvol_props_mask; // Mask of volume properties
  213. DWORD afpvol_curr_uses; // Number of curr open connections.
  214. LPWSTR afpvol_path; // The actual path
  215. // Ignored for VolumeSetInfo
  216. } AFP_VOLUME_INFO, *PAFP_VOLUME_INFO;
  217. typedef struct _AFP_SESSION_INFO
  218. {
  219. DWORD afpsess_id; // Id of the session
  220. LPWSTR afpsess_ws_name; // Workstation Name,
  221. LPWSTR afpsess_username; // User Name, max. UNLEN
  222. DWORD afpsess_num_cons; // Number of open volumes
  223. DWORD afpsess_num_opens; // Number of open files
  224. LONG afpsess_time; // Time session established
  225. DWORD afpsess_logon_type; // How the user logged on
  226. } AFP_SESSION_INFO, *PAFP_SESSION_INFO;
  227. // afpicon_type values
  228. #define ICONTYPE_SRVR 0 // Large, monochrome
  229. #define ICONTYPE_ICN 1 // Large. monochrome
  230. #define ICONTYPE_ICS 2 // Small, monochrome
  231. #define ICONTYPE_ICN4 3 // Large, 4 color
  232. #define ICONTYPE_ICN8 4 // Large, 8 color
  233. #define ICONTYPE_ICS4 5 // Small, 4 color
  234. #define ICONTYPE_ICS8 6 // Small, 8 color
  235. #define MAX_ICONTYPE 7
  236. // afpicon_length values
  237. #define ICONSIZE_ICN 256 // Large. monochrome
  238. #define ICONSIZE_ICS 64 // Small, monochrome
  239. #define ICONSIZE_ICN4 1024// Large, 4 color
  240. #define ICONSIZE_ICN8 2048// Large, 8 color
  241. #define ICONSIZE_ICS4 256 // Small, 4 color
  242. #define ICONSIZE_ICS8 512 // Small, 8 color
  243. typedef struct _AFP_ICON_INFO
  244. {
  245. WCHAR afpicon_type[AFP_TYPE_LEN+1]; // Resource Type
  246. WCHAR afpicon_creator[AFP_CREATOR_LEN+1]; // Resource Creator
  247. DWORD afpicon_icontype; // Icon type
  248. DWORD afpicon_length; // Length of icon block
  249. PBYTE afpicon_data; // The actual icon.
  250. } AFP_ICON_INFO, *PAFP_ICON_INFO;
  251. // The AfpAdminConnectionEnum Filter values
  252. #define AFP_NO_FILTER 0
  253. #define AFP_FILTER_ON_VOLUME_ID 1
  254. #define AFP_FILTER_ON_SESSION_ID 2
  255. typedef struct _AFP_CONNECTION_INFO
  256. {
  257. DWORD afpconn_id; // Connection Id
  258. LPWSTR afpconn_username; // User who has this session open
  259. // Max. UNLEN
  260. LPWSTR afpconn_volumename; // Volume corresponding to this
  261. // connection
  262. ULONG afpconn_time; // Time since the vol was opened.(secs)
  263. DWORD afpconn_num_opens; // Number of open resources
  264. } AFP_CONNECTION_INFO, *PAFP_CONNECTION_INFO;
  265. // Various File open modes
  266. #define AFP_OPEN_MODE_NONE 0x00000000
  267. #define AFP_OPEN_MODE_READ 0x00000001
  268. #define AFP_OPEN_MODE_WRITE 0x00000002
  269. // Fork type of an open file
  270. #define AFP_FORK_DATA 0x00000000
  271. #define AFP_FORK_RESOURCE 0x00000001
  272. typedef struct _AFP_FILE_INFO
  273. {
  274. DWORD afpfile_id; // Id of the open file fork
  275. DWORD afpfile_open_mode; // Mode in which file is opened
  276. DWORD afpfile_num_locks; // Number of locks on the file
  277. DWORD afpfile_fork_type; // Fork type
  278. LPWSTR afpfile_username; // File opened by this user. max UNLEN
  279. LPWSTR afpfile_path; // Absolute canonical path to the file
  280. } AFP_FILE_INFO, *PAFP_FILE_INFO;
  281. // The following bits define the permissions mask
  282. // NOTE: These MUST be consistent with the AFP permissions
  283. #define AFP_PERM_WORLD_SFO 0x00010000
  284. #define AFP_PERM_WORLD_SFI 0x00020000
  285. #define AFP_PERM_WORLD_MC 0x00040000
  286. #define AFP_PERM_WORLD_MASK 0x00070000
  287. #define AFP_PERM_GROUP_SFO 0x00000100
  288. #define AFP_PERM_GROUP_SFI 0x00000200
  289. #define AFP_PERM_GROUP_MC 0x00000400
  290. #define AFP_PERM_GROUP_MASK 0x00000700
  291. #define AFP_PERM_OWNER_SFO 0x00000001
  292. #define AFP_PERM_OWNER_SFI 0x00000002
  293. #define AFP_PERM_OWNER_MC 0x00000004
  294. #define AFP_PERM_OWNER_MASK 0x00000007
  295. #define AFP_PERM_INHIBIT_MOVE_DELETE 0x01000000
  296. #define AFP_PERM_SET_SUBDIRS 0x02000000
  297. // The following bits define the fields within the AFP_DIRECTORY_INFO
  298. // structure whose values will be set.
  299. //
  300. #define AFP_DIR_PARMNUM_PERMS 0x00000001
  301. #define AFP_DIR_PARMNUM_OWNER 0x00000002
  302. #define AFP_DIR_PARMNUM_GROUP 0x00000004
  303. #define AFP_DIR_PARMNUM_ALL ( AFP_DIR_PARMNUM_PERMS \
  304. | AFP_DIR_PARMNUM_OWNER \
  305. | AFP_DIR_PARMNUM_GROUP )
  306. typedef struct _AFP_DIRECTORY_INFO
  307. {
  308. LPWSTR afpdir_path; // Absolute dir path,
  309. DWORD afpdir_perms; // Directory permissions
  310. LPWSTR afpdir_owner; // Directory owner, max. UNLEN
  311. LPWSTR afpdir_group; // Group Association max. GNLEN
  312. BOOLEAN afpdir_in_volume; // TRUE indicates that this directory
  313. // is part of a volume, FALSE otherwise.
  314. } AFP_DIRECTORY_INFO, *PAFP_DIRECTORY_INFO;
  315. // The following bits define the fields within the AFP_FINDER_INFO
  316. // structure whos values will be set
  317. //
  318. #define AFP_FD_PARMNUM_TYPE 0x00000001
  319. #define AFP_FD_PARMNUM_CREATOR 0x00000002
  320. #define AFP_FD_PARMNUM_ALL ( AFP_FD_PARMNUM_TYPE \
  321. | AFP_FD_PARMNUM_CREATOR)
  322. typedef struct _AFP_FINDER_INFO
  323. {
  324. LPWSTR afpfd_path; // Absolute file/dir path
  325. WCHAR afpfd_type[AFP_TYPE_LEN+1]; // Finder type
  326. WCHAR afpfd_creator[AFP_CREATOR_LEN+1]; // Finder creator
  327. } AFP_FINDER_INFO, *PAFP_FINDER_INFO;
  328. typedef struct _AFP_EXTENSION {
  329. WCHAR afpe_extension[AFP_EXTENSION_LEN+1];
  330. DWORD afpe_tcid;
  331. } AFP_EXTENSION, *PAFP_EXTENSION;
  332. typedef struct _AFP_TYPE_CREATOR
  333. {
  334. WCHAR afptc_creator[AFP_CREATOR_LEN+1]; // Resource Creator
  335. WCHAR afptc_type[AFP_TYPE_LEN+1]; // Resource Type
  336. WCHAR afptc_comment[AFP_ETC_COMMENT_LEN+1];
  337. DWORD afptc_id;
  338. } AFP_TYPE_CREATOR, *PAFP_TYPE_CREATOR;
  339. typedef struct _AFP_MESSAGE_INFO
  340. {
  341. DWORD afpmsg_session_id; // Session Id of the user to which
  342. // the message is to be sent.
  343. LPWSTR afpmsg_text; // Must be at most AFP_MESSAGE_LEN
  344. } AFP_MESSAGE_INFO, *PAFP_MESSAGE_INFO;
  345. typedef struct _AFP_ETCMAP_INFO {
  346. DWORD afpetc_num_type_creators;
  347. #ifdef MIDL_PASS
  348. [size_is(afpetc_num_type_creators)] PAFP_TYPE_CREATOR afpetc_type_creator;
  349. #else
  350. PAFP_TYPE_CREATOR afpetc_type_creator;
  351. #endif
  352. DWORD afpetc_num_extensions;
  353. #ifdef MIDL_PASS
  354. [size_is(afpetc_num_extensions)] PAFP_EXTENSION afpetc_extension;
  355. #else
  356. PAFP_EXTENSION afpetc_extension;
  357. #endif
  358. } AFP_ETCMAP_INFO, *PAFP_ETCMAP_INFO;
  359. /* Our version of the AFP Function codes organized by class */
  360. #define _AFP_INVALID_OPCODE 0x00
  361. #define _AFP_UNSUPPORTED_OPCODE 0x01
  362. #define _AFP_GET_SRVR_INFO 0x02 /* SERVER APIs */
  363. #define _AFP_GET_SRVR_PARMS 0x03
  364. #define _AFP_CHANGE_PASSWORD 0x04
  365. #define _AFP_LOGIN 0x05
  366. #define _AFP_LOGIN_CONT 0x06
  367. #define _AFP_LOGOUT 0x07
  368. #define _AFP_MAP_ID 0x08
  369. #define _AFP_MAP_NAME 0x09
  370. #define _AFP_GET_USER_INFO 0x0A
  371. #define _AFP_GET_SRVR_MSG 0x0B
  372. #define _AFP_GET_DOMAIN_LIST 0x0C
  373. #define _AFP_OPEN_VOL 0x0D /* VOLUME APIs */
  374. #define _AFP_CLOSE_VOL 0x0E
  375. #define _AFP_GET_VOL_PARMS 0x0F
  376. #define _AFP_SET_VOL_PARMS 0x10
  377. #define _AFP_FLUSH 0x11
  378. #define _AFP_GET_FILE_DIR_PARMS 0x12 /* FILE-DIRECTORY APIs */
  379. #define _AFP_SET_FILE_DIR_PARMS 0x13
  380. #define _AFP_DELETE 0x14
  381. #define _AFP_RENAME 0x15
  382. #define _AFP_MOVE_AND_RENAME 0x16
  383. #define _AFP_OPEN_DIR 0x17 /* DIRECTORY APIs */
  384. #define _AFP_CLOSE_DIR 0x18
  385. #define _AFP_CREATE_DIR 0x19
  386. #define _AFP_ENUMERATE 0x1A
  387. #define _AFP_SET_DIR_PARMS 0x1B
  388. #define _AFP_CREATE_FILE 0x1C /* FILE APIs */
  389. #define _AFP_COPY_FILE 0x1D
  390. #define _AFP_CREATE_ID 0x1E
  391. #define _AFP_DELETE_ID 0x1F
  392. #define _AFP_RESOLVE_ID 0x20
  393. #define _AFP_SET_FILE_PARMS 0x21
  394. #define _AFP_EXCHANGE_FILES 0x22
  395. #define _AFP_OPEN_FORK 0x23 /* FORK APIs */
  396. #define _AFP_CLOSE_FORK 0x24
  397. #define _AFP_FLUSH_FORK 0x25
  398. #define _AFP_READ 0x26
  399. #define _AFP_WRITE 0x27
  400. #define _AFP_BYTE_RANGE_LOCK 0x28
  401. #define _AFP_GET_FORK_PARMS 0x29
  402. #define _AFP_SET_FORK_PARMS 0x2A
  403. #define _AFP_OPEN_DT 0x2B /* DESKTOP APIs */
  404. #define _AFP_CLOSE_DT 0x2C
  405. #define _AFP_ADD_APPL 0x2D
  406. #define _AFP_GET_APPL 0x2E
  407. #define _AFP_REMOVE_APPL 0x2F
  408. #define _AFP_ADD_COMMENT 0x30
  409. #define _AFP_GET_COMMENT 0x31
  410. #define _AFP_REMOVE_COMMENT 0x32
  411. #define _AFP_ADD_ICON 0x33
  412. #define _AFP_GET_ICON 0x34
  413. #define _AFP_GET_ICON_INFO 0x35
  414. #define _AFP_CAT_SEARCH 0x36
  415. #define _AFP_MAX_ENTRIES 0x38 /* Keep it even */
  416. typedef struct _AFP_STATISTICS_INFO
  417. {
  418. DWORD stat_ServerStartTime; // Server start time
  419. DWORD stat_TimeStamp; // Statistics collected since
  420. DWORD stat_Errors; // Unexpected Errors
  421. DWORD stat_MaxSessions; // Max. sessions active simulataneously
  422. DWORD stat_TotalSessions; // Total number of sessions created
  423. DWORD stat_CurrentSessions; // Number of sessions active now
  424. DWORD stat_NumAdminReqs; // Total number of admin requests
  425. DWORD stat_NumAdminChanges; // Number of admin reqs causing change
  426. // The file statistics are actually fork statistics i.e. opening both the
  427. // data and the resource forks will yield a count of TWO
  428. DWORD stat_MaxFilesOpened; // Max. files opened simulataneously
  429. DWORD stat_TotalFilesOpened; // Total number of files opened
  430. DWORD stat_CurrentFilesOpen; // Number of files open now
  431. DWORD stat_CurrentFileLocks; // Current count of locks
  432. DWORD stat_NumFailedLogins; // Number of unsuccessful logins
  433. DWORD stat_NumForcedLogoffs; // Number of sessions kicked out
  434. DWORD stat_NumMessagesSent; // Number of messages sent out
  435. DWORD stat_MaxNonPagedUsage; // High-water mark of the non-paged
  436. // memory usage
  437. DWORD stat_CurrNonPagedUsage; // Amount of non-paged memory in use
  438. DWORD stat_MaxPagedUsage; // High-water mark of the paged
  439. // memory usage
  440. DWORD stat_CurrPagedUsage; // Amount of paged memory in use
  441. } AFP_STATISTICS_INFO, *PAFP_STATISTICS_INFO;
  442. typedef struct _AFP_STATISTICS_INFO_EX
  443. {
  444. DWORD stat_ServerStartTime; // Server start time
  445. DWORD stat_TimeStamp; // Statistics collected since
  446. DWORD stat_Errors; // Unexpected Errors
  447. DWORD stat_MaxSessions; // Max. sessions active simulataneously
  448. DWORD stat_TotalSessions; // Total number of sessions created
  449. DWORD stat_CurrentSessions; // Number of sessions active now
  450. DWORD stat_NumAdminReqs; // Total number of admin requests
  451. DWORD stat_NumAdminChanges; // Number of admin reqs causing change
  452. // The file statistics are actually fork statistics i.e. opening both the
  453. // data and the resource forks will yield a count of TWO
  454. DWORD stat_MaxFilesOpened; // Max. files opened simulataneously
  455. DWORD stat_TotalFilesOpened; // Total number of files opened
  456. DWORD stat_CurrentFilesOpen; // Number of files open now
  457. DWORD stat_CurrentFileLocks; // Current count of locks
  458. DWORD stat_NumFailedLogins; // Number of unsuccessful logins
  459. DWORD stat_NumForcedLogoffs; // Number of sessions kicked out
  460. DWORD stat_NumMessagesSent; // Number of messages sent out
  461. DWORD stat_MaxNonPagedUsage; // High-water mark of the non-paged
  462. // memory usage
  463. DWORD stat_CurrNonPagedUsage; // Amount of non-paged memory in use
  464. DWORD stat_MaxPagedUsage; // High-water mark of the paged
  465. // memory usage
  466. DWORD stat_CurrPagedUsage; // Amount of paged memory in use
  467. // NOTE: MAKE SURE THE STRUCTURE ABOVE THIS LINE MATCHES EXACTLY THE AFP_STATISTICS_INFO
  468. DWORD stat_PagedCount; // Number of current allocations
  469. DWORD stat_NonPagedCount; // Number of current allocations
  470. DWORD stat_EnumCacheHits; // # of times cache was hit
  471. DWORD stat_EnumCacheMisses; // # of times cache was missed
  472. DWORD stat_IoPoolHits; // # of times Io Pool was hit
  473. DWORD stat_IoPoolMisses; // # of times Io Pool was missed
  474. DWORD stat_MaxInternalOpens; // Max # of internal opens
  475. DWORD stat_TotalInternalOpens;// Total # of internal opens
  476. DWORD stat_CurrentInternalOpens;// Current # of internal opens
  477. DWORD stat_CurrQueueLength; // # of requests in the queue
  478. DWORD stat_MaxQueueLength; // Max # of requests in the queue
  479. DWORD stat_CurrThreadCount; // # of worker threads active
  480. DWORD stat_MaxThreadCount; // Max # of worker threads active
  481. // Make sure the following is Quadword aligned for efficiency
  482. LARGE_INTEGER stat_DataRead; // Amount of data read (disk)
  483. LARGE_INTEGER stat_DataWritten; // Amount of data written (disk)
  484. LARGE_INTEGER stat_DataReadInternal; // Amount of data read (disk)
  485. LARGE_INTEGER stat_DataWrittenInternal;// Amount of data written (disk)
  486. LARGE_INTEGER stat_DataOut; // Amount of data sent out (wire)
  487. LARGE_INTEGER stat_DataIn; // Amount of data read in (wire)
  488. DWORD stat_TcpSessions; // TCP sessions currently active
  489. DWORD stat_MaxTcpSessions; // Max TCP Sessions active simultaneously
  490. } AFP_STATISTICS_INFO_EX, *PAFP_STATISTICS_INFO_EX;
  491. typedef struct _AFP_PROFILE_INFO
  492. {
  493. DWORD perf_ApiCounts[_AFP_MAX_ENTRIES];
  494. // # of times each Api is called
  495. LARGE_INTEGER perf_ApiCumTimes[_AFP_MAX_ENTRIES];
  496. // Cummulative time spent in Apis
  497. LARGE_INTEGER perf_ApiWorstTime[_AFP_MAX_ENTRIES];
  498. // Worst time for an api
  499. LARGE_INTEGER perf_ApiBestTime[_AFP_MAX_ENTRIES];
  500. // Best time for an api
  501. LARGE_INTEGER perf_OpenTimeRA; // Time spent in NtOpenFile for ReadAttr
  502. LARGE_INTEGER perf_OpenTimeRC; // Time spent in NtOpenFile for ReadControl
  503. LARGE_INTEGER perf_OpenTimeWC; // Time spent in NtOpenFile for WriteControl
  504. LARGE_INTEGER perf_OpenTimeRW; // Time spent in NtOpenFile for Read/Write
  505. LARGE_INTEGER perf_OpenTimeDL; // Time spent in NtOpenFile for Delete
  506. LARGE_INTEGER perf_OpenTimeDR; // Time spent in NtOpenFile for Directories
  507. LARGE_INTEGER perf_CreateTimeFIL; // Time spent in NtCreateFile for file/data stream
  508. LARGE_INTEGER perf_CreateTimeSTR; // Time spent in NtCreateFile for file/other streams
  509. LARGE_INTEGER perf_CreateTimeDIR; // Time spent in NtCreateFile for dir/data stream
  510. LARGE_INTEGER perf_CloseTime; // Time spent in NtClose
  511. LARGE_INTEGER perf_DeleteTime; // Time spent in NtSetInformationFile
  512. LARGE_INTEGER perf_GetInfoTime; // Time spent in NtQueryInformationFile
  513. LARGE_INTEGER perf_SetInfoTime; // Time spent in NtSetInformationFile
  514. LARGE_INTEGER perf_GetPermsTime; // Time spent on getting permissions
  515. LARGE_INTEGER perf_SetPermsTime; // Time spent on setting permissions
  516. LARGE_INTEGER perf_PathMapTime; // Time spent in pathmap code
  517. LARGE_INTEGER perf_ScavengerTime; // Time spent in scavenger
  518. LARGE_INTEGER perf_IdIndexUpdTime; // Time spent updating idindex
  519. LARGE_INTEGER perf_DesktopUpdTime; // Time spent updating desktop
  520. LARGE_INTEGER perf_SwmrWaitTime; // Time spent waiting for Swmr
  521. LARGE_INTEGER perf_SwmrLockTimeR; // Time swmr was locked for read
  522. LARGE_INTEGER perf_SwmrLockTimeW; // Time swmr was locked for write
  523. LARGE_INTEGER perf_QueueTime; // Time Apis spent in queue
  524. LARGE_INTEGER perf_UnmarshallTime; // Time spent in un-marshalling a request
  525. LARGE_INTEGER perf_InterReqTime; // Time elapse between subsequent requests
  526. LARGE_INTEGER perf_ExAllocTimeN; // Time spent in ExAllocatePool (NonPaged)
  527. LARGE_INTEGER perf_ExFreeTimeN; // Time spent in ExFreePool (NonPaged)
  528. LARGE_INTEGER perf_ExAllocTimeP; // Time spent in ExAllocatePool (Paged)
  529. LARGE_INTEGER perf_ExFreeTimeP; // Time spent in ExFreePool (Paged)
  530. LARGE_INTEGER perf_AfpAllocTimeN; // Time spent in AfpAllocateMemory (NonPaged)
  531. LARGE_INTEGER perf_AfpFreeTimeN; // Time spent in AfpFreeMemory (NonPaged)
  532. LARGE_INTEGER perf_AfpAllocTimeP; // Time spent in AfpAllocateMemory (Paged)
  533. LARGE_INTEGER perf_AfpFreeTimeP; // Time spent in AfpFreeMemory (Paged)
  534. LARGE_INTEGER perf_BPAllocTime; // Time spent in BP Alloc
  535. LARGE_INTEGER perf_BPFreeTime; // Time spent in BP Free
  536. LARGE_INTEGER perf_DFEAllocTime; // Time spent in allocating a DFE
  537. LARGE_INTEGER perf_DFEFreeTime; // Time spent in freeing a DFE
  538. LARGE_INTEGER perf_ChangeNotifyTime; // Time spent processing change notifies
  539. LARGE_INTEGER perf_ScanTreeTime; // Time spent in scanning a directory tree
  540. LARGE_INTEGER perf_PerfFreq; // Perf. counter frequency
  541. DWORD perf_NumFastIoSucceeded;// Fast IO success count
  542. DWORD perf_NumFastIoFailed; // Fast Io failure count
  543. DWORD perf_OpenCountRA; // # of times NtOpenFile called for ReadAttr
  544. DWORD perf_OpenCountRC; // # of times NtOpenFile called for ReadControl
  545. DWORD perf_OpenCountWC; // # of times NtOpenFile called for WriteControl
  546. DWORD perf_OpenCountRW; // # of times NtOpenFile called for Read/Write
  547. DWORD perf_OpenCountDL; // # of times NtOpenFile called for Delete
  548. DWORD perf_OpenCountDR; // # of times NtOpenFile called for Directories
  549. DWORD perf_CreateCountFIL; // # of times NtCreateFile called - file/data
  550. DWORD perf_CreateCountSTR; // # of times NtCreateFile called - file/other
  551. DWORD perf_CreateCountDIR; // # of times NtCreateFile called - dir/data
  552. DWORD perf_CloseCount; // # of times NtClose called
  553. DWORD perf_DeleteCount; // # of times NtSetInformationFile called
  554. DWORD perf_GetInfoCount; // # of times NtQueryInformationFile called
  555. DWORD perf_SetInfoCount; // # of times NtSetInformationFile called
  556. DWORD perf_GetPermsCount; // # of times Get permissions called
  557. DWORD perf_SetPermsCount; // # of times Get permissions called
  558. DWORD perf_PathMapCount; // # of times PathMap was invoked
  559. DWORD perf_ScavengerCount; // # of times scavenger was scheduled
  560. DWORD perf_IdIndexUpdCount; // # of times idindex was updated
  561. DWORD perf_DesktopUpdCount; // # of times desktop was updated
  562. DWORD perf_SwmrWaitCount; // # of times swmr access was blocked
  563. DWORD perf_SwmrLockCountR; // # of times swmr was locked for read
  564. DWORD perf_SwmrLockCountW; // # of times swmr was locked for write
  565. DWORD perf_SwmrUpgradeCount; // # of times swmr was upgraded
  566. DWORD perf_SwmrDowngradeCount;// # of times swmr was downgraded
  567. DWORD perf_QueueCount; // # of times worker was queued
  568. DWORD perf_UnmarshallCount; // # of times api unmarshalling done
  569. DWORD perf_ReqCount; // # of apis - this is essentially total of perf_ApiCounts[i]
  570. DWORD perf_ExAllocCountN; // # of times in ExAllocatePool (NonPaged) called
  571. DWORD perf_ExFreeCountN; // # of times in ExFreePool (NonPaged) called
  572. DWORD perf_ExAllocCountP; // # of times in ExAllocatePool (Paged) called
  573. DWORD perf_ExFreeCountP; // # of times in ExFreePool (Paged) called
  574. DWORD perf_AfpAllocCountN; // # of times in AfpAllocateMemory (NonPaged) called
  575. DWORD perf_AfpFreeCountN; // # of times in AfpFreeMemory (NonPaged) called
  576. DWORD perf_AfpAllocCountP; // # of times in AfpAllocateMemory (Paged) called
  577. DWORD perf_AfpFreeCountP; // # of times in AfpFreeMemory (Paged) called
  578. DWORD perf_BPAllocCount; // # of times in BP Alloc called
  579. DWORD perf_BPFreeCount; // # of times in BP Free called
  580. DWORD perf_BPAgeCount; // # of times in BP aged out
  581. DWORD perf_DFEAllocCount; // # of times in a DFE is allocated
  582. DWORD perf_DFEFreeCount; // # of times in a DFE is freed
  583. DWORD perf_DFEAgeCount; // # of times in DFE aged out
  584. DWORD perf_ChangeNotifyCount; // # of times ChangeNotify called
  585. DWORD perf_ScanTreeCount; // # of items scanned during scantree
  586. DWORD perf_NumDfeLookupByName;// # of times DFE lookup by Name was called
  587. DWORD perf_NumDfeLookupById; // # of times DFE lookup by Id was called
  588. DWORD perf_DfeDepthTraversed; // How deep in the hash buckets did we go
  589. DWORD perf_DfeCacheHits; // # of times DFE cache was hit
  590. DWORD perf_DfeCacheMisses; // # of times DFE cache was missed
  591. DWORD perf_MaxDfrdReqCount; // Current # of request deferred
  592. DWORD perf_CurDfrdReqCount; // Max # of request deferred
  593. DWORD perf_cAllocatedIrps; // Total # of Irps allocated
  594. DWORD perf_cAllocatedMdls; // Total # of Mdls allocated
  595. } AFP_PROFILE_INFO, *PAFP_PROFILE_INFO;
  596. // AfpAdminXXX API prototypes
  597. //
  598. DWORD
  599. AfpAdminConnect(
  600. IN LPWSTR lpwsServerName,
  601. OUT PAFP_SERVER_HANDLE phAfpServer
  602. );
  603. VOID
  604. AfpAdminDisconnect(
  605. IN AFP_SERVER_HANDLE hAfpServer
  606. );
  607. VOID
  608. AfpAdminBufferFree(
  609. IN PVOID pBuffer
  610. );
  611. DWORD
  612. AfpAdminVolumeEnum(
  613. IN AFP_SERVER_HANDLE hAfpServer,
  614. OUT LPBYTE * lpbBuffer,
  615. IN DWORD dwPrefMaxLen,
  616. OUT LPDWORD lpdwEntriesRead,
  617. OUT LPDWORD lpdwTotalEntries,
  618. IN LPDWORD lpdwResumeHandle
  619. );
  620. DWORD
  621. AfpAdminVolumeSetInfo (
  622. IN AFP_SERVER_HANDLE hAfpServer,
  623. IN LPBYTE pBuffer,
  624. IN DWORD dwParmNum
  625. );
  626. DWORD
  627. AfpAdminVolumeGetInfo (
  628. IN AFP_SERVER_HANDLE hAfpServer,
  629. IN LPWSTR lpwsVolumeName,
  630. OUT LPBYTE * lpbBuffer
  631. );
  632. DWORD
  633. AfpAdminVolumeDelete(
  634. IN AFP_SERVER_HANDLE hAfpServer,
  635. IN LPWSTR lpwsVolumeName
  636. );
  637. DWORD
  638. AfpAdminVolumeAdd(
  639. IN AFP_SERVER_HANDLE hAfpServer,
  640. IN LPBYTE pBuffer
  641. );
  642. DWORD
  643. AfpAdminInvalidVolumeEnum(
  644. IN AFP_SERVER_HANDLE hAfpServer,
  645. OUT LPBYTE * lpbBuffer,
  646. OUT LPDWORD lpdwEntriesRead
  647. );
  648. DWORD
  649. AfpAdminInvalidVolumeDelete(
  650. IN AFP_SERVER_HANDLE hAfpServer,
  651. IN LPWSTR lpwsVolumeName
  652. );
  653. DWORD
  654. AfpAdminDirectoryGetInfo(
  655. IN AFP_SERVER_HANDLE hAfpServer,
  656. IN LPWSTR lpwsPath,
  657. OUT LPBYTE *ppAfpDirectoryInfo
  658. );
  659. DWORD
  660. AfpAdminDirectorySetInfo(
  661. IN AFP_SERVER_HANDLE hAfpServer,
  662. IN LPBYTE pAfpDirectoryInfo,
  663. IN DWORD dwParmNum
  664. );
  665. DWORD
  666. AfpAdminServerGetInfo(
  667. IN AFP_SERVER_HANDLE hAfpServer,
  668. OUT LPBYTE *ppAfpServerInfo
  669. );
  670. DWORD
  671. AfpAdminServerSetInfo(
  672. IN AFP_SERVER_HANDLE hAfpServer,
  673. IN LPBYTE pAfpServerInfo,
  674. IN DWORD dwParmNum
  675. );
  676. DWORD
  677. AfpAdminSessionEnum(
  678. IN AFP_SERVER_HANDLE hAfpServer,
  679. OUT LPBYTE * lpbBuffer,
  680. IN DWORD dwPrefMaxLen,
  681. OUT LPDWORD lpdwEntriesRead,
  682. OUT LPDWORD lpdwTotalEntries,
  683. IN LPDWORD lpdwResumeHandle
  684. );
  685. DWORD
  686. AfpAdminSessionClose(
  687. IN AFP_SERVER_HANDLE hAfpServer,
  688. IN DWORD dwSessionId
  689. );
  690. DWORD
  691. AfpAdminConnectionEnum(
  692. IN AFP_SERVER_HANDLE hAfpServer,
  693. OUT LPBYTE * lpbBuffer,
  694. IN DWORD dwFilter,
  695. IN DWORD dwId,
  696. IN DWORD dwPrefMaxLen,
  697. OUT LPDWORD lpdwEntriesRead,
  698. OUT LPDWORD lpdwTotalEntries,
  699. IN LPDWORD lpdwResumeHandle
  700. );
  701. DWORD
  702. AfpAdminConnectionClose(
  703. IN AFP_SERVER_HANDLE hAfpServer,
  704. IN DWORD dwConnectionId
  705. );
  706. DWORD
  707. AfpAdminFileEnum(
  708. IN AFP_SERVER_HANDLE hAfpServer,
  709. OUT LPBYTE * lpbBuffer,
  710. IN DWORD dwPrefMaxLen,
  711. OUT LPDWORD lpdwEntriesRead,
  712. OUT LPDWORD lpdwTotalEntries,
  713. IN LPDWORD lpdwResumeHandle
  714. );
  715. DWORD
  716. AfpAdminFileClose(
  717. IN AFP_SERVER_HANDLE hAfpServer,
  718. IN DWORD dwConnectionId
  719. );
  720. DWORD
  721. AfpAdminETCMapGetInfo(
  722. IN AFP_SERVER_HANDLE hAfpServer,
  723. OUT LPBYTE * ppbBuffer
  724. );
  725. DWORD
  726. AfpAdminETCMapAdd(
  727. IN AFP_SERVER_HANDLE hAfpServer,
  728. IN PAFP_TYPE_CREATOR pAfpTypeCreator
  729. );
  730. DWORD
  731. AfpAdminETCMapDelete(
  732. IN AFP_SERVER_HANDLE hAfpServer,
  733. IN PAFP_TYPE_CREATOR pAfpTypeCreator
  734. );
  735. DWORD
  736. AfpAdminETCMapSetInfo(
  737. IN AFP_SERVER_HANDLE hAfpServer,
  738. IN PAFP_TYPE_CREATOR pAfpTypeCreator
  739. );
  740. DWORD
  741. AfpAdminETCMapAssociate(
  742. IN AFP_SERVER_HANDLE hAfpServer,
  743. IN PAFP_TYPE_CREATOR pAfpTypeCreator,
  744. IN PAFP_EXTENSION pAfpExtension
  745. );
  746. DWORD
  747. AfpAdminMessageSend(
  748. IN AFP_SERVER_HANDLE hAfpServer,
  749. IN PAFP_MESSAGE_INFO pAfpMessage
  750. );
  751. DWORD
  752. AfpAdminStatisticsGet(
  753. IN AFP_SERVER_HANDLE hAfpServer,
  754. OUT LPBYTE * ppbBuffer
  755. );
  756. DWORD
  757. AfpAdminStatisticsGetEx(
  758. IN AFP_SERVER_HANDLE hAfpServer,
  759. OUT LPBYTE * ppbBuffer
  760. );
  761. DWORD
  762. AfpAdminStatisticsClear(
  763. IN AFP_SERVER_HANDLE hAfpServer
  764. );
  765. DWORD
  766. AfpAdminProfileGet(
  767. IN AFP_SERVER_HANDLE hAfpServer,
  768. OUT LPBYTE * ppbBuffer
  769. );
  770. DWORD
  771. AfpAdminProfileClear(
  772. IN AFP_SERVER_HANDLE hAfpServer
  773. );
  774. DWORD
  775. AfpAdminFinderSetInfo(
  776. IN AFP_SERVER_HANDLE hAfpServer,
  777. IN LPWSTR pType,
  778. IN LPWSTR pCreator,
  779. IN LPWSTR pData,
  780. IN LPWSTR pResource,
  781. IN LPWSTR pTarget,
  782. IN DWORD dwParmNum
  783. );
  784. #endif // _MACFILE_