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.

646 lines
20 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. srvfsctl.h
  5. Abstract:
  6. This module defines I/O control codes and structures for the File
  7. System Driver of the LAN Manager server.
  8. Author:
  9. David Treadwell (davidtr) 22-May-1990
  10. Revision History:
  11. --*/
  12. #ifndef _SRVFSCTL_
  13. #define _SRVFSCTL_
  14. //
  15. // The name of the server device.
  16. //
  17. #define SERVER_DEVICE_NAME TEXT("\\Device\\LanmanServer")
  18. //
  19. // IRP control codes used to send requests to the server. These are
  20. // used as parameters to NtFsControlFile, and may be found in
  21. // Irp->Parameters.FsControl.FsControlCode in the server dispatch
  22. // routine.
  23. //
  24. // Note that the low two bits of this code indicate the "method" in
  25. // which the IO system uses the buffers passed by the user to
  26. // NtFsControlFile. We use method 0--normal, buffered output (not
  27. // DMA)--for non-API requests, and method 3--"neither" IO--for API
  28. // requests that get processed in the server FSD. For the APIs
  29. // that are processed in the server FSP, use method 0.
  30. //
  31. // !!! Add more as necessary.
  32. #define FSCTL_SRV_BASE FILE_DEVICE_NETWORK
  33. #define FSCTL_SRV_API 1 << 11
  34. #define _SRV_CONTROL_CODE(request,method) \
  35. ((FSCTL_SRV_BASE)<<12 | (request<<2) | method)
  36. #define _SRV_API_CONTROL_CODE(request) \
  37. ((FSCTL_SRV_BASE)<<12 | FSCTL_SRV_API | (request<<2) | METHOD_NEITHER )
  38. #define SRV_API_INDEX(code) \
  39. ((code & ~(0xFFFFF000 | FSCTL_SRV_API)) >> 2)
  40. //
  41. // Standard FSCTLs.
  42. //
  43. #define FSCTL_SRV_STARTUP _SRV_CONTROL_CODE( 0, METHOD_NEITHER )
  44. #define FSCTL_SRV_SHUTDOWN _SRV_CONTROL_CODE( 1, METHOD_NEITHER )
  45. #define FSCTL_SRV_CLEAR_STATISTICS _SRV_CONTROL_CODE( 2, METHOD_BUFFERED )
  46. #define FSCTL_SRV_GET_STATISTICS _SRV_CONTROL_CODE( 3, METHOD_BUFFERED )
  47. #define FSCTL_SRV_SET_DEBUG _SRV_CONTROL_CODE( 4, METHOD_BUFFERED )
  48. #define FSCTL_SRV_XACTSRV_CONNECT _SRV_CONTROL_CODE( 5, METHOD_BUFFERED )
  49. #define FSCTL_SRV_SEND_DATAGRAM _SRV_CONTROL_CODE( 6, METHOD_NEITHER )
  50. #define FSCTL_SRV_SET_PASSWORD_SERVER _SRV_CONTROL_CODE( 7, METHOD_BUFFERED )
  51. #define FSCTL_SRV_START_SMBTRACE _SRV_CONTROL_CODE( 8, METHOD_BUFFERED )
  52. #define FSCTL_SRV_SMBTRACE_FREE_SMB _SRV_CONTROL_CODE( 9, METHOD_BUFFERED )
  53. #define FSCTL_SRV_END_SMBTRACE _SRV_CONTROL_CODE( 10, METHOD_BUFFERED )
  54. #define FSCTL_SRV_QUERY_CONNECTIONS _SRV_CONTROL_CODE( 11, METHOD_BUFFERED )
  55. #define FSCTL_SRV_PAUSE _SRV_CONTROL_CODE( 12, METHOD_NEITHER )
  56. #define FSCTL_SRV_CONTINUE _SRV_CONTROL_CODE( 13, METHOD_NEITHER )
  57. #define FSCTL_SRV_GET_CHALLENGE _SRV_CONTROL_CODE( 14, METHOD_BUFFERED )
  58. #define FSCTL_SRV_GET_DEBUG_STATISTICS _SRV_CONTROL_CODE( 15, METHOD_BUFFERED )
  59. #define FSCTL_SRV_XACTSRV_DISCONNECT _SRV_CONTROL_CODE( 16, METHOD_BUFFERED )
  60. #define FSCTL_SRV_REGISTRY_CHANGE _SRV_CONTROL_CODE( 17, METHOD_NEITHER )
  61. #define FSCTL_SRV_GET_QUEUE_STATISTICS _SRV_CONTROL_CODE( 18, METHOD_BUFFERED )
  62. #define FSCTL_SRV_SHARE_STATE_CHANGE _SRV_CONTROL_CODE( 19, METHOD_BUFFERED )
  63. #define FSCTL_SRV_BEGIN_PNP_NOTIFICATIONS _SRV_CONTROL_CODE(20, METHOD_BUFFERED )
  64. #define FSCTL_SRV_CHANGE_DOMAIN_NAME _SRV_CONTROL_CODE( 21, METHOD_BUFFERED )
  65. #define FSCTL_SRV_INTERNAL_TEST_REAUTH _SRV_CONTROL_CODE( 22, METHOD_BUFFERED )
  66. #define FSCTL_SRV_CHANGE_DNS_DOMAIN_NAME _SRV_CONTROL_CODE( 23, METHOD_BUFFERED )
  67. #define FSCTL_SRV_ENUMERATE_SNAPSHOTS _SRV_CONTROL_CODE( 24, METHOD_BUFFERED )
  68. //
  69. // The following FSCTL can be issued by a kernel driver to hook into the server
  70. // for accelerated direct host IPX performance. A pointer to an SRV_IPX_SMART_CARD
  71. // structure is given for the START fsctl as the InputBuffer.
  72. #define FSCTL_SRV_IPX_SMART_CARD_START _SRV_CONTROL_CODE( 21, METHOD_NEITHER )
  73. //
  74. // API FSCTLs.
  75. //
  76. // *** The order of these must match the order of API processors in
  77. // the SrvApiDispatchTable jump table defined in ntos\srv\srvdata.c!
  78. #define FSCTL_SRV_NET_CONNECTION_ENUM _SRV_API_CONTROL_CODE( 0 )
  79. #define FSCTL_SRV_NET_FILE_CLOSE _SRV_API_CONTROL_CODE( 1 )
  80. #define FSCTL_SRV_NET_FILE_ENUM _SRV_API_CONTROL_CODE( 2 )
  81. #define FSCTL_SRV_NET_SERVER_DISK_ENUM _SRV_API_CONTROL_CODE( 3 )
  82. #define FSCTL_SRV_NET_SERVER_SET_INFO _SRV_API_CONTROL_CODE( 4 )
  83. #define FSCTL_SRV_NET_SERVER_XPORT_ADD _SRV_API_CONTROL_CODE( 5 )
  84. #define FSCTL_SRV_NET_SERVER_XPORT_DEL _SRV_API_CONTROL_CODE( 6 )
  85. #define FSCTL_SRV_NET_SERVER_XPORT_ENUM _SRV_API_CONTROL_CODE( 7 )
  86. #define FSCTL_SRV_NET_SESSION_DEL _SRV_API_CONTROL_CODE( 8 )
  87. #define FSCTL_SRV_NET_SESSION_ENUM _SRV_API_CONTROL_CODE( 9 )
  88. #define FSCTL_SRV_NET_SHARE_ADD _SRV_API_CONTROL_CODE( 10 )
  89. #define FSCTL_SRV_NET_SHARE_DEL _SRV_API_CONTROL_CODE( 11 )
  90. #define FSCTL_SRV_NET_SHARE_ENUM _SRV_API_CONTROL_CODE( 12 )
  91. #define FSCTL_SRV_NET_SHARE_SET_INFO _SRV_API_CONTROL_CODE( 13 )
  92. #define FSCTL_SRV_NET_STATISTICS_GET _SRV_API_CONTROL_CODE( 14 )
  93. #define FSCTL_SRV_MAX_API_CODE FSCTL_SRV_NET_STATISTICS_GET
  94. //
  95. // Startup information level
  96. //
  97. #define SS_STARTUP_LEVEL -1L
  98. #ifdef INCLUDE_SRV_IPX_SMART_CARD_INTERFACE
  99. //
  100. // Structure passed to the srv via the FSCTL_SRV_IPX_SMART_CARD_START call by an
  101. // intelligent direct host IPX card. The Smart card fills in its own
  102. // Open, Close, Read, and DeRegister entry points - which the server
  103. // calls at the appropriate times. The server fills in its own
  104. // ReadComplete entry point which the smart card calls when it is done
  105. // transferring the data to the client.
  106. //
  107. typedef struct {
  108. //
  109. // This routine is called by the server when it is opening a file on
  110. // behalf of a direct host IPX client. It gives the smart card a chance
  111. // to decide it it wants to help with file access. If the smart card is
  112. // interested, it should return TRUE and set SmartCardContext to a
  113. // non-zero value of its choice.
  114. //
  115. BOOLEAN (* Open)(
  116. IN PVOID SmbHeader, // Points to request PNT_SMB_HEADER
  117. IN PFILE_OBJECT FileObject, // FileObject opened by the client
  118. IN PUNICODE_STRING FileName, // Name of the file opened by the client
  119. IN PTDI_ADDRESS_IPX IpxAddress, // Address of the client
  120. IN ULONG Flags, // FO_CACHE_SUPPORTED (for now)
  121. OUT PVOID *SmartCardContext // Context value returned by this routine
  122. );
  123. //
  124. // This is called by the server when the file is being closed. The context
  125. // value received at Open time is passed to this routine.
  126. //
  127. VOID ( * Close )(
  128. IN PVOID SmartCardContext // Same context returned by Open() above
  129. );
  130. //
  131. // This is called by the server to see if the smart card wishes to handle the
  132. // client's read request. If the card is handling the read, it should return
  133. // TRUE and the server will discontinue processing the read. When the card is
  134. // finished handling the read, it must call ReadComplete (below) to inform the
  135. // server. If Read returns FALSE, the server handles the read as usual.
  136. //
  137. BOOLEAN ( * Read )(
  138. IN PVOID SmbHeader, // Points to request PNT_SMB_HEADER
  139. IN PVOID SmartCardContext, // Same context returned by Open() above
  140. IN ULONG Key, // Key value needed to read through locks
  141. IN PVOID SrvContext // Opaque value provided by the server
  142. );
  143. //
  144. // This is the server's entry point which the smart card must call when it is
  145. // finished handling the Read request (above).
  146. //
  147. VOID ( * ReadComplete )(
  148. IN PVOID SrvContext, // Same as SrvContext in Read() above
  149. IN PFILE_OBJECT FileObject, // Client FileObject to which this applies
  150. IN PMDL Mdl OPTIONAL, // Mdl smart card is now finished with
  151. IN ULONG Length // Length of data indicated by the MDL
  152. );
  153. //
  154. // This is called by the server when the server wishes to disconnect from the
  155. // card. Once this returns, the card should not call back into the server.
  156. //
  157. VOID ( *DeRegister )(
  158. VOID
  159. );
  160. } SRV_IPX_SMART_CARD, *PSRV_IPX_SMART_CARD;
  161. #endif
  162. //
  163. // SMB_STATISTICS holds the count of SMBs and total turn around for a
  164. // class of SMBs. For example, a single SMB_STATISTIC structure could
  165. // hold information about all read SMBs: Read, ReadAndX, ReadRaw,
  166. // and ReadMultiplexed.
  167. //
  168. typedef struct _SMB_STATISTICS {
  169. LARGE_INTEGER TotalTurnaroundTime;
  170. ULONG SmbCount;
  171. } SMB_STATISTICS, *PSMB_STATISTICS;
  172. //
  173. // Used to record the number of times something happened and some
  174. // pertinent time measure.
  175. //
  176. typedef struct _SRV_TIMED_COUNTER {
  177. LARGE_INTEGER Time;
  178. ULONG Count;
  179. } SRV_TIMED_COUNTER, *PSRV_TIMED_COUNTER;
  180. //
  181. // SRV_POOL_STATISTICS is used for tracking server pool usage, paged and
  182. // nonpaged. It is only enabled with SRVDBG2 and is controlled in the
  183. // server module heapmgr.c.
  184. //
  185. typedef struct _SRV_POOL_STATISTICS {
  186. ULONG TotalBlocksAllocated;
  187. ULONG TotalBytesAllocated;
  188. ULONG TotalBlocksFreed;
  189. ULONG TotalBytesFreed;
  190. ULONG BlocksInUse;
  191. ULONG BytesInUse;
  192. ULONG MaxBlocksInUse;
  193. ULONG MaxBytesInUse;
  194. } SRV_POOL_STATISTICS, *PSRV_POOL_STATISTICS;
  195. //
  196. // BLOCK_COUNTS is used to maintain statistics on server block types
  197. //
  198. typedef struct _BLOCK_COUNTS {
  199. ULONG Allocations;
  200. ULONG Closes;
  201. ULONG Frees;
  202. } BLOCK_COUNTS, *PBLOCK_COUNTS;
  203. #define MAX_NON_TRANS_SMB 0x84
  204. #ifndef TRANS2_MAX_FUNCTION
  205. #define TRANS2_MAX_FUNCTION 0x11
  206. #endif
  207. #define MAX_STATISTICS_SMB MAX_NON_TRANS_SMB + TRANS2_MAX_FUNCTION + 1
  208. //
  209. // SRV_STATISTICS is the structure returned to the FSCTL_GET_STATISTICS
  210. // fsctl.
  211. //
  212. typedef struct _SRV_STATISTICS {
  213. //
  214. // The time at which statistics gathering began (or stats were last
  215. // cleared).
  216. //
  217. TIME StatisticsStartTime;
  218. //
  219. // Large integer counts of bytes received and sent
  220. //
  221. LARGE_INTEGER TotalBytesReceived;
  222. LARGE_INTEGER TotalBytesSent;
  223. //
  224. // Causes of session termination
  225. //
  226. ULONG SessionLogonAttempts;
  227. ULONG SessionsTimedOut;
  228. ULONG SessionsErroredOut;
  229. ULONG SessionsLoggedOff;
  230. ULONG SessionsForcedLogOff;
  231. //
  232. // Misc. Errors
  233. //
  234. ULONG LogonErrors;
  235. ULONG AccessPermissionErrors;
  236. ULONG GrantedAccessErrors;
  237. ULONG SystemErrors;
  238. ULONG BlockingSmbsRejected;
  239. ULONG WorkItemShortages;
  240. //
  241. // Cumulative counts of various statistics. Note that when stats are
  242. // cleared, those "Total" fields which have a "Current" equivalent
  243. // are set to the "Current" value to avoid situations where the
  244. // current count is greater than the total.
  245. //
  246. ULONG TotalFilesOpened;
  247. ULONG CurrentNumberOfOpenFiles;
  248. ULONG CurrentNumberOfSessions;
  249. ULONG CurrentNumberOfOpenSearches;
  250. //
  251. // Memory usage stats we want to xport
  252. //
  253. ULONG CurrentNonPagedPoolUsage;
  254. ULONG NonPagedPoolFailures;
  255. ULONG PeakNonPagedPoolUsage;
  256. ULONG CurrentPagedPoolUsage;
  257. ULONG PagedPoolFailures;
  258. ULONG PeakPagedPoolUsage;
  259. //
  260. // Used to record the number of times work context blocks were placed
  261. // on the server's FSP queue and the total amount of time they spent
  262. // there.
  263. //
  264. SRV_TIMED_COUNTER TotalWorkContextBlocksQueued;
  265. ULONG CompressedReads;
  266. ULONG CompressedReadsRejected;
  267. ULONG CompressedReadsFailed;
  268. ULONG CompressedWrites;
  269. ULONG CompressedWritesRejected;
  270. ULONG CompressedWritesFailed;
  271. ULONG CompressedWritesExpanded;
  272. } SRV_STATISTICS, *PSRV_STATISTICS;
  273. //
  274. // Per work-queue statistics for the server. There is a workqueue for each
  275. // processor in the system for nonblocking work, and a single workqueue for
  276. // blocking work.
  277. //
  278. // These statistics are retrieved via FSCTL_SRV_GET_QUEUE_STATISTICS to the
  279. // server driver. For an N-processor system, the first N structs are per-processor,
  280. // the N+1'th struct is for the blocking work queue.
  281. //
  282. typedef struct _SRV_QUEUE_STATISTICS {
  283. ULONG QueueLength; // current length of the workitem queue
  284. ULONG ActiveThreads; // # of threads currently servicing requests
  285. ULONG AvailableThreads; // # of threads waiting for work
  286. ULONG FreeWorkItems; // # of free work items
  287. ULONG StolenWorkItems; // # of work items taken from this free list
  288. // by another queue
  289. ULONG NeedWorkItem; // # of work items we are currently short for this queue
  290. ULONG CurrentClients; // # of clients being serviced by this queue
  291. LARGE_INTEGER BytesReceived; // # of bytes in from the network to clients on this queue
  292. LARGE_INTEGER BytesSent; // # of bytes sent to the network from clients on this queue
  293. LARGE_INTEGER ReadOperations; // # file read operations by clients on this queue
  294. LARGE_INTEGER BytesRead; // # of data bytes read from files by clients on this queue
  295. LARGE_INTEGER WriteOperations; // # of file write ops by clients on this queue
  296. LARGE_INTEGER BytesWritten; // # of data bytes written to files by clients on this queue
  297. SRV_TIMED_COUNTER TotalWorkContextBlocksQueued; // as above, but per-queue
  298. } SRV_QUEUE_STATISTICS, *PSRV_QUEUE_STATISTICS;
  299. //
  300. // SRV_STATISTICS_DEBUG is the structure used for the
  301. // FSCTL_SRV_GET_DEBUG_STATISTICS fsctl. This structure is valid
  302. // only when SRVDBG3 is set.
  303. //
  304. typedef struct _SRV_STATISTICS_DEBUG {
  305. //
  306. // Large integer counts of bytes read and written.
  307. //
  308. LARGE_INTEGER TotalBytesRead;
  309. LARGE_INTEGER TotalBytesWritten;
  310. //
  311. // Raw reads and writes statistics
  312. //
  313. ULONG RawWritesAttempted;
  314. ULONG RawWritesRejected;
  315. ULONG RawReadsAttempted;
  316. ULONG RawReadsRejected;
  317. //
  318. // Cumulative count of time spent opening files and closing handles.
  319. //
  320. LARGE_INTEGER TotalIoCreateFileTime;
  321. LARGE_INTEGER TotalNtCloseTime;
  322. ULONG TotalHandlesClosed;
  323. ULONG TotalOpenAttempts;
  324. ULONG TotalOpensForPathOperations;
  325. ULONG TotalOplocksGranted;
  326. ULONG TotalOplocksDenied;
  327. ULONG TotalOplocksBroken;
  328. ULONG OpensSatisfiedWithCachedRfcb;
  329. ULONG FastLocksAttempted;
  330. ULONG FastLocksFailed;
  331. ULONG FastReadsAttempted;
  332. ULONG FastReadsFailed;
  333. ULONG FastUnlocksAttempted;
  334. ULONG FastUnlocksFailed;
  335. ULONG FastWritesAttempted;
  336. ULONG FastWritesFailed;
  337. ULONG DirectSendsAttempted;
  338. ULONG LockViolations;
  339. ULONG LockDelays;
  340. ULONG CoreSearches;
  341. ULONG CompleteCoreSearches;
  342. //
  343. // information about block types
  344. //
  345. BLOCK_COUNTS ConnectionInfo;
  346. BLOCK_COUNTS EndpointInfo;
  347. BLOCK_COUNTS LfcbInfo;
  348. BLOCK_COUNTS MfcbInfo;
  349. BLOCK_COUNTS RfcbInfo;
  350. BLOCK_COUNTS SearchInfo;
  351. BLOCK_COUNTS SessionInfo;
  352. BLOCK_COUNTS ShareInfo;
  353. BLOCK_COUNTS TransactionInfo;
  354. BLOCK_COUNTS TreeConnectInfo;
  355. BLOCK_COUNTS WorkContextInfo;
  356. BLOCK_COUNTS WaitForOplockBreakInfo;
  357. //
  358. // Statistics for different read and write sizes. Each element of
  359. // the array corresponds to a range of IO sizes; see srv\smbsupp.c
  360. // for exact correspondences.
  361. //
  362. SMB_STATISTICS ReadSize[17];
  363. SMB_STATISTICS WriteSize[17];
  364. //
  365. // Statistics for each SMB type by command code.
  366. //
  367. SMB_STATISTICS Smb[MAX_STATISTICS_SMB+2+TRANS2_MAX_FUNCTION+1];
  368. struct {
  369. ULONG Depth;
  370. ULONG Threads;
  371. ULONG ItemsQueued;
  372. ULONG MaximumDepth;
  373. } QueueStatistics[3];
  374. } SRV_STATISTICS_DEBUG, *PSRV_STATISTICS_DEBUG;
  375. //
  376. // SET DEBUG input and output structure. Contains off/on masks for SrvDebug
  377. // and SmbDebug. The off mask is applied first, then the on mask is
  378. // applied. To set the entire mask to a specific value, set the off
  379. // mask to all ones, and set the on mask to the desired value. To leave
  380. // a mask unchanged, set both masks to 0. SET DEBUG is also used
  381. // to modify other server heuristics. HeuristicsChangeMask is used to
  382. // indicate which heuristics are being changed.
  383. //
  384. // On output, the structure is presented in such a way as to allow the
  385. // original values to be restored easily. The output data is simply
  386. // passed back as input data.
  387. //
  388. typedef struct _FSCTL_SRV_SET_DEBUG_IN_OUT {
  389. ULONG SrvDebugOff;
  390. ULONG SrvDebugOn;
  391. ULONG SmbDebugOff;
  392. ULONG SmbDebugOn;
  393. ULONG CcDebugOff;
  394. ULONG CcDebugOn;
  395. ULONG PbDebugOff;
  396. ULONG PbDebugOn;
  397. ULONG FatDebugOff;
  398. ULONG FatDebugOn;
  399. ULONG HeuristicsChangeMask;
  400. ULONG MaxCopyReadLength;
  401. ULONG MaxCopyWriteLength;
  402. ULONG DumpVerbosity;
  403. ULONG DumpRawLength;
  404. BOOLEAN EnableOplocks;
  405. BOOLEAN EnableFcbOpens;
  406. BOOLEAN EnableSoftCompatibility;
  407. BOOLEAN EnableRawMode;
  408. BOOLEAN EnableDpcLevelProcessing;
  409. BOOLEAN EnableMdlIo;
  410. BOOLEAN EnableFastIo;
  411. BOOLEAN DumpRequests;
  412. BOOLEAN DumpResponses;
  413. } FSCTL_SRV_SET_DEBUG_IN_OUT, *PFSCTL_SRV_SET_DEBUG_IN_OUT;
  414. //
  415. // Bit assignments for server heuristics change mask. The first group
  416. // contains those that are values, while the second group contains those
  417. // that are booleans.
  418. //
  419. #define SRV_HEUR_MAX_COPY_READ 0x00000001
  420. #define SRV_HEUR_MAX_COPY_WRITE 0x00000002
  421. #define SRV_HEUR_DUMP_VERBOSITY 0x00000004
  422. #define SRV_HEUR_DUMP_RAW_LENGTH 0x00000008
  423. #define SRV_HEUR_OPLOCKS 0x00010000
  424. #define SRV_HEUR_FCB_OPENS 0x00020000
  425. #define SRV_HEUR_SOFT_COMPATIBILITY 0x00040000
  426. #define SRV_HEUR_RAW_MODE 0x00080000
  427. #define SRV_HEUR_DPC_LEVEL_PROCESSING 0x00100000
  428. #define SRV_HEUR_MDL_IO 0x00200000
  429. #define SRV_HEUR_FAST_IO 0x00400000
  430. #define SRV_HEUR_DUMP_REQUESTS 0x00800000
  431. #define SRV_HEUR_DUMP_RESPONSES 0x01000000
  432. //
  433. // Structure returned in response to FSCTL_SRV_QUERY_CONNECTIONS.
  434. //
  435. typedef struct _BLOCK_INFORMATION {
  436. PVOID Block;
  437. ULONG BlockType;
  438. ULONG BlockState;
  439. ULONG ReferenceCount;
  440. } BLOCK_INFORMATION, *PBLOCK_INFORMATION;
  441. //
  442. // Structure for communication between the file server and the server
  443. // service.
  444. //
  445. typedef struct _SERVER_REQUEST_PACKET {
  446. UNICODE_STRING Name1;
  447. UNICODE_STRING Name2;
  448. ULONG Level;
  449. ULONG ErrorCode;
  450. ULONG Flags;
  451. union {
  452. struct {
  453. ULONG EntriesRead;
  454. ULONG TotalEntries;
  455. ULONG TotalBytesNeeded;
  456. ULONG ResumeHandle;
  457. } Get;
  458. struct {
  459. ULONG ErrorParameter;
  460. union {
  461. struct {
  462. ULONG MaxUses;
  463. } ShareInfo;
  464. } Api;
  465. } Set;
  466. } Parameters;
  467. } SERVER_REQUEST_PACKET, *PSERVER_REQUEST_PACKET;
  468. //
  469. // Flags for the Flags field of the server request packet.
  470. //
  471. #define SRP_RETURN_SINGLE_ENTRY 0x01
  472. #define SRP_CLEAR_STATISTICS 0x02
  473. #define SRP_SET_SHARE_IN_DFS 0x04
  474. #define SRP_CLEAR_SHARE_IN_DFS 0x08
  475. //
  476. // Flags used in the XPORT_ADD function
  477. //
  478. #define SRP_XADD_PRIMARY_MACHINE 0x1 // this is the primary machine name
  479. #define SRP_XADD_REMAP_PIPE_NAMES 0x2 // remap pipe names to separate dir
  480. //
  481. // The valid set of flags for the XPORT_ADD function
  482. //
  483. #define SRP_XADD_FLAGS (SRP_XADD_PRIMARY_MACHINE | SRP_XADD_REMAP_PIPE_NAMES)
  484. //
  485. // #defines for the share GENERIC_MAPPING structure, which must be available
  486. // to both the server and the server service.
  487. //
  488. #define SRVSVC_SHARE_CONNECT 0x0001
  489. #define SRVSVC_PAUSED_SHARE_CONNECT 0x0002
  490. #define SRVSVC_SHARE_CONNECT_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED | \
  491. SRVSVC_SHARE_CONNECT | \
  492. SRVSVC_PAUSED_SHARE_CONNECT )
  493. #define GENERIC_SHARE_CONNECT_MAPPING { \
  494. STANDARD_RIGHTS_READ | \
  495. SRVSVC_SHARE_CONNECT, \
  496. STANDARD_RIGHTS_WRITE | \
  497. SRVSVC_PAUSED_SHARE_CONNECT, \
  498. STANDARD_RIGHTS_EXECUTE, \
  499. SRVSVC_SHARE_CONNECT_ALL_ACCESS }
  500. //
  501. // #defines for the file GENERIC_MAPPING structure, which must be available
  502. // to both the server and the server service. This structure is identical
  503. // to the io file generic mapping "IopFileMapping" defined in io\ioinit.c
  504. //
  505. #define GENERIC_SHARE_FILE_ACCESS_MAPPING { \
  506. FILE_GENERIC_READ, \
  507. FILE_GENERIC_WRITE, \
  508. FILE_GENERIC_EXECUTE, \
  509. FILE_ALL_ACCESS }
  510. //
  511. // Special cases of STYPE_DISKTREE
  512. //
  513. #define STYPE_CDROM 104
  514. #define STYPE_REMOVABLE 105
  515. #ifdef INCLUDE_SMB_PERSISTENT
  516. #define STYPE_PERSISTENT 0x40000000
  517. #endif
  518. #endif // ndef _SRVFSCTL_