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.

1104 lines
41 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. smbtrans.h
  5. Abstract:
  6. This file contains request and response structure definitions for
  7. the specific parameters of Transaction and Transaction2 SMBs.
  8. Author:
  9. Chuck Lenzmeier (chuckl) 23-Feb-1990
  10. David Treadwell (davidtr)
  11. Revision History:
  12. --*/
  13. #ifndef _SMBTRANS_
  14. #define _SMBTRANS_
  15. //#include <nt.h>
  16. //#include <smbtypes.h>
  17. //#include <smb.h>
  18. //
  19. // Force misalignment of the following structures
  20. //
  21. #ifndef NO_PACKING
  22. #include <packon.h>
  23. #endif // ndef NO_PACKING
  24. //
  25. // Named pipe function codes
  26. //
  27. #define TRANS_SET_NMPIPE_STATE 0x01
  28. #define TRANS_RAW_READ_NMPIPE 0x11
  29. #define TRANS_QUERY_NMPIPE_STATE 0x21
  30. #define TRANS_QUERY_NMPIPE_INFO 0x22
  31. #define TRANS_PEEK_NMPIPE 0x23
  32. #define TRANS_TRANSACT_NMPIPE 0x26
  33. #define TRANS_RAW_WRITE_NMPIPE 0x31
  34. #define TRANS_READ_NMPIPE 0x36
  35. #define TRANS_WRITE_NMPIPE 0x37
  36. #define TRANS_WAIT_NMPIPE 0x53
  37. #define TRANS_CALL_NMPIPE 0x54
  38. //
  39. // Mailslot function code
  40. //
  41. #define TRANS_MAILSLOT_WRITE 0x01
  42. //
  43. // Transaction2 function codes
  44. //
  45. #define TRANS2_OPEN2 0x00
  46. #define TRANS2_FIND_FIRST2 0x01
  47. #define TRANS2_FIND_NEXT2 0x02
  48. #define TRANS2_QUERY_FS_INFORMATION 0x03
  49. #define TRANS2_SET_FS_INFORMATION 0x04
  50. #define TRANS2_QUERY_PATH_INFORMATION 0x05
  51. #define TRANS2_SET_PATH_INFORMATION 0x06
  52. #define TRANS2_QUERY_FILE_INFORMATION 0x07
  53. #define TRANS2_SET_FILE_INFORMATION 0x08
  54. #define TRANS2_FSCTL 0x09
  55. #define TRANS2_IOCTL2 0x0A
  56. #define TRANS2_FIND_NOTIFY_FIRST 0x0B
  57. #define TRANS2_FIND_NOTIFY_NEXT 0x0C
  58. #define TRANS2_CREATE_DIRECTORY 0x0D
  59. #define TRANS2_SESSION_SETUP 0x0E
  60. #define TRANS2_QUERY_FS_INFORMATION_FID 0x0F
  61. #define TRANS2_GET_DFS_REFERRAL 0x10
  62. #define TRANS2_REPORT_DFS_INCONSISTENCY 0x11
  63. #define TRANS2_MAX_FUNCTION 0x11
  64. //
  65. // Nt Transaction function codes
  66. //
  67. #define NT_TRANSACT_MIN_FUNCTION 1
  68. #define NT_TRANSACT_CREATE 1
  69. #define NT_TRANSACT_IOCTL 2
  70. #define NT_TRANSACT_SET_SECURITY_DESC 3
  71. #define NT_TRANSACT_NOTIFY_CHANGE 4
  72. #define NT_TRANSACT_RENAME 5
  73. #define NT_TRANSACT_QUERY_SECURITY_DESC 6
  74. #define NT_TRANSACT_QUERY_QUOTA 7
  75. #define NT_TRANSACT_SET_QUOTA 8
  76. #define NT_TRANSACT_MAX_FUNCTION 8
  77. //
  78. // File information levels
  79. //
  80. #define SMB_INFO_STANDARD 1
  81. #define SMB_INFO_QUERY_EA_SIZE 2
  82. #define SMB_INFO_SET_EAS 2
  83. #define SMB_INFO_QUERY_EAS_FROM_LIST 3
  84. #define SMB_INFO_QUERY_ALL_EAS 4 // undocumented but supported
  85. #define SMB_INFO_QUERY_FULL_NAME 5 // never sent by redir
  86. #define SMB_INFO_IS_NAME_VALID 6
  87. #define SMB_INFO_PASSTHROUGH 1000 // any info above here is a simple pass-through
  88. //
  89. // NT extension to file info levels
  90. //
  91. #define SMB_QUERY_FILE_BASIC_INFO 0x101
  92. #define SMB_QUERY_FILE_STANDARD_INFO 0x102
  93. #define SMB_QUERY_FILE_EA_INFO 0x103
  94. #define SMB_QUERY_FILE_NAME_INFO 0x104
  95. #define SMB_QUERY_FILE_ALLOCATION_INFO 0x105
  96. #define SMB_QUERY_FILE_END_OF_FILEINFO 0x106
  97. #define SMB_QUERY_FILE_ALL_INFO 0x107
  98. #define SMB_QUERY_FILE_ALT_NAME_INFO 0x108
  99. #define SMB_QUERY_FILE_STREAM_INFO 0x109
  100. #define SMB_QUERY_FILE_COMPRESSION_INFO 0x10B
  101. #define SMB_SET_FILE_BASIC_INFO 0x101
  102. #define SMB_SET_FILE_DISPOSITION_INFO 0x102
  103. #define SMB_SET_FILE_ALLOCATION_INFO 0x103
  104. #define SMB_SET_FILE_END_OF_FILE_INFO 0x104
  105. #define SMB_QUERY_FS_LABEL_INFO 0x101
  106. #define SMB_QUERY_FS_VOLUME_INFO 0x102
  107. #define SMB_QUERY_FS_SIZE_INFO 0x103
  108. #define SMB_QUERY_FS_DEVICE_INFO 0x104
  109. #define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105
  110. #define SMB_QUERY_FS_QUOTA_INFO 0x106 // unused?
  111. #define SMB_QUERY_FS_CONTROL_INFO 0x107
  112. //
  113. // Volume information levels.
  114. //
  115. #define SMB_INFO_ALLOCATION 1
  116. #define SMB_INFO_VOLUME 2
  117. //
  118. // Rename2 information levels.
  119. //
  120. #define SMB_NT_RENAME_MOVE_CLUSTER_INFO 0x102
  121. #define SMB_NT_RENAME_SET_LINK_INFO 0x103
  122. #define SMB_NT_RENAME_RENAME_FILE 0x104 // Server internal
  123. #define SMB_NT_RENAME_MOVE_FILE 0x105 // Server internal
  124. //
  125. // Protocol for NtQueryQuotaInformationFile
  126. //
  127. typedef struct {
  128. _USHORT( Fid ); // FID of target
  129. UCHAR ReturnSingleEntry; // Indicates that only a single entry should be returned
  130. // rather than filling the buffer with as
  131. // many entries as possible.
  132. UCHAR RestartScan; // Indicates whether the scan of the quota information
  133. // is to be restarted from the beginning.
  134. _ULONG ( SidListLength ); // Supplies the length of the SID list if present
  135. _ULONG ( StartSidLength ); // Supplies an optional SID that indicates that the returned
  136. // information is to start with an entry other
  137. // than the first. This parameter is ignored if a
  138. // SidList is given
  139. _ULONG( StartSidOffset); // Supplies the offset of Start Sid in the buffer
  140. } REQ_NT_QUERY_FS_QUOTA_INFO, *PREQ_NT_QUERY_FS_QUOTA_INFO;
  141. //
  142. // Desciptor response
  143. //
  144. // Data Bytes: The Quota Information
  145. //
  146. typedef struct {
  147. _ULONG ( Length );
  148. } RESP_NT_QUERY_FS_QUOTA_INFO, *PRESP_NT_QUERY_FS_QUOTA_INFO;
  149. //
  150. // Protocol for NtSetQuotaInformationFile
  151. //
  152. typedef struct {
  153. _USHORT( Fid ); // FID of target
  154. } REQ_NT_SET_FS_QUOTA_INFO, *PREQ_NT_SET_FS_QUOTA_INFO;
  155. //
  156. // Response:
  157. //
  158. // Setup words: None.
  159. // Parameter Bytes: None.
  160. // Data Bytes: None.
  161. //
  162. #ifdef INCLUDE_SMB_CAIRO
  163. //
  164. // protocol for sessionsetup as trans2
  165. // function is srvsmbsessionsetup (int srv\smbtrans.c)
  166. // #define TRANS2_SESSION_SETUP 0x0E
  167. //
  168. typedef struct _REQ_CAIRO_TRANS2_SESSION_SETUP {
  169. UCHAR WordCount; // Count of parameter words = 6
  170. UCHAR Pad; // So things are aligned
  171. _USHORT ( MaxBufferSize ); // Max transmit buffer size
  172. _USHORT ( MaxMpxCount ); // Max pending multiplexed requests
  173. _USHORT ( VcNumber ); // 0 = first (only), nonzero=additional VC number
  174. _ULONG ( SessionKey ); // Session key (valid iff VcNumber != 0)
  175. _ULONG ( Capabilities ); // Server capabilities
  176. _ULONG ( BufferLength );
  177. UCHAR Buffer[1];
  178. //UCHAR KerberosTicket[]; // The KerberosTicket
  179. } REQ_CAIRO_TRANS2_SESSION_SETUP;
  180. typedef REQ_CAIRO_TRANS2_SESSION_SETUP *PREQ_CAIRO_TRANS2_SESSION_SETUP; // *** NOT SMB_UNALIGNED!
  181. typedef struct _RESP_CAIRO_TRANS2_SESSION_SETUP {
  182. UCHAR WordCount; // Count of parameter words = 0
  183. UCHAR Pad; // So things are aligned
  184. _USHORT( Uid ); // Unauthenticated user id
  185. _ULONG ( BufferLength );
  186. UCHAR Buffer[1];
  187. //UCHAR KerberosTicket[]; // The KerberosTicket
  188. } RESP_CAIRO_TRANS2_SESSION_SETUP;
  189. typedef RESP_CAIRO_TRANS2_SESSION_SETUP *PRESP_CAIRO_TRANS2_SESSION_SETUP; // *** NOT SMB_UNALIGNED!
  190. typedef struct _REQ_QUERY_FS_INFORMATION_FID {
  191. _USHORT( InformationLevel );
  192. _USHORT( Fid );
  193. } REQ_QUERY_FS_INFORMATION_FID;
  194. typedef REQ_QUERY_FS_INFORMATION_FID SMB_UNALIGNED *PREQ_QUERY_FS_INFORMATION_FID;
  195. //
  196. // Setup words for NT I/O control request
  197. //
  198. struct _TempSetup {
  199. _ULONG( FunctionCode );
  200. _USHORT( Fid );
  201. BOOLEAN IsFsctl;
  202. UCHAR IsFlags;
  203. };
  204. typedef struct _REQ_CAIRO_IO_CONTROL {
  205. _USHORT( Trans2Function ); // used for Trans2, but not NT transact
  206. _ULONG( FunctionCode );
  207. _USHORT( Fid );
  208. BOOLEAN IsFsctl;
  209. UCHAR IsFlags;
  210. } REQ_CAIRO_IO_CONTROL;
  211. typedef REQ_CAIRO_IO_CONTROL SMB_UNALIGNED *PREQ_CAIRO_IO_CONTROL;
  212. //
  213. // For Cairo remoting general FSCTLS
  214. //
  215. #define IsTID 1
  216. #endif // INCLUDE_SMB_CAIRO
  217. //
  218. // Dfs Transactions
  219. //
  220. //
  221. // Request for Referral.
  222. //
  223. typedef struct {
  224. USHORT MaxReferralLevel; // Latest version of referral understood
  225. UCHAR RequestFileName[1]; // Dfs name for which referral is sought
  226. } REQ_GET_DFS_REFERRAL;
  227. typedef REQ_GET_DFS_REFERRAL SMB_UNALIGNED *PREQ_GET_DFS_REFERRAL;
  228. //
  229. // The format of an individual referral contains version and length information
  230. // allowing the client to skip referrals it does not understand.
  231. //
  232. // !! All referral elements must have VersionNumber and Size as the first 2 elements !!
  233. //
  234. typedef struct {
  235. USHORT VersionNumber; // == 1
  236. USHORT Size; // Size of this whole element
  237. USHORT ServerType; // Type of server: 0 == Don't know, 1 == SMB, 2 == Netware
  238. struct {
  239. USHORT StripPath : 1; // Strip off PathConsumed characters from front of
  240. // DfsPathName prior to submitting name to UncShareName
  241. };
  242. WCHAR ShareName[1]; // The server+share name go right here. NULL terminated.
  243. } DFS_REFERRAL_V1;
  244. typedef DFS_REFERRAL_V1 SMB_UNALIGNED *PDFS_REFERRAL_V1;
  245. typedef struct {
  246. USHORT VersionNumber; // == 2
  247. USHORT Size; // Size of this whole element
  248. USHORT ServerType; // Type of server: 0 == Don't know, 1 == SMB, 2 == Netware
  249. struct {
  250. USHORT StripPath : 1; // Strip off PathConsumed characters from front of
  251. // DfsPathName prior to submitting name to UncShareName
  252. };
  253. ULONG Proximity; // Hint of transport cost
  254. ULONG TimeToLive; // In number of seconds
  255. USHORT DfsPathOffset; // Offset from beginning of this element to Path to access
  256. USHORT DfsAlternatePathOffset; // Offset from beginning of this element to 8.3 path
  257. USHORT NetworkAddressOffset; // Offset from beginning of this element to Network path
  258. } DFS_REFERRAL_V2;
  259. typedef DFS_REFERRAL_V2 SMB_UNALIGNED *PDFS_REFERRAL_V2;
  260. typedef struct {
  261. USHORT VersionNumber; // == 3
  262. USHORT Size; // Size of this whole element
  263. USHORT ServerType; // Type of server: 0 == Don't know, 1 == SMB, 2 == Netware
  264. struct {
  265. USHORT StripPath : 1; // Strip off PathConsumed characters from front of
  266. // DfsPathName prior to submitting name to UncShareName
  267. USHORT NameListReferral : 1; // This referral contains an expanded name list
  268. };
  269. ULONG TimeToLive; // In number of seconds
  270. union {
  271. struct {
  272. USHORT DfsPathOffset; // Offset from beginning of this element to Path to access
  273. USHORT DfsAlternatePathOffset; // Offset from beginning of this element to 8.3 path
  274. USHORT NetworkAddressOffset; // Offset from beginning of this element to Network path
  275. GUID ServiceSiteGuid; // The guid for the site
  276. };
  277. struct {
  278. USHORT SpecialNameOffset; // Offset from this element to the special name string
  279. USHORT NumberOfExpandedNames; // Number of expanded names
  280. USHORT ExpandedNameOffset; // Offset from this element to the expanded name list
  281. };
  282. };
  283. } DFS_REFERRAL_V3;
  284. typedef DFS_REFERRAL_V3 SMB_UNALIGNED *PDFS_REFERRAL_V3;
  285. typedef struct {
  286. USHORT PathConsumed; // Number of WCHARs consumed in DfsPathName
  287. USHORT NumberOfReferrals; // Number of referrals contained here
  288. struct {
  289. ULONG ReferralServers : 1; // Elements in Referrals[] are referral servers
  290. ULONG StorageServers : 1; // Elements in Referrals[] are storage servers
  291. };
  292. union { // The vector of referrals
  293. DFS_REFERRAL_V1 v1;
  294. DFS_REFERRAL_V2 v2;
  295. DFS_REFERRAL_V3 v3;
  296. } Referrals[1]; // [ NumberOfReferrals ]
  297. //
  298. // WCHAR StringBuffer[]; // Used by DFS_REFERRAL_V2
  299. //
  300. } RESP_GET_DFS_REFERRAL;
  301. typedef RESP_GET_DFS_REFERRAL SMB_UNALIGNED *PRESP_GET_DFS_REFERRAL;
  302. //
  303. // During Dfs operations, a client may discover a knowledge inconsistency in the Dfs.
  304. // The parameter portion of the TRANS2_REPORT_DFS_INCONSISTENCY SMB is
  305. // encoded in this way
  306. //
  307. typedef struct {
  308. UCHAR RequestFileName[1]; // Dfs name for which inconsistency is being reported
  309. union {
  310. DFS_REFERRAL_V1 v1; // The single referral thought to be in error
  311. } Referral;
  312. } REQ_REPORT_DFS_INCONSISTENCY;
  313. typedef REQ_REPORT_DFS_INCONSISTENCY SMB_UNALIGNED *PREQ_REPORT_DFS_INCONSISTENCY;
  314. //
  315. // The client also needs to send to this server the referral which it believes to be
  316. // in error. The data part of this transaction contains the errant referral(s), encoded
  317. // as above in the DFS_REFERRAL_* structures.
  318. //
  319. //
  320. // Find First, information levels
  321. //
  322. #define SMB_FIND_FILE_DIRECTORY_INFO 0x101
  323. #define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
  324. #define SMB_FIND_FILE_NAMES_INFO 0x103
  325. #define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
  326. #define SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO 0x105
  327. #define SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO 0x106
  328. #ifdef INCLUDE_SMB_DIRECTORY
  329. //
  330. // CreateDirectory2 function code os Transaction2 SMB, see #3 page 51
  331. // Function is SrvSmbCreateDirectory2()
  332. // TRANS2_CREATE_DIRECTORY 0x0D
  333. //
  334. typedef struct _REQ_CREATE_DIRECTORY2 {
  335. _ULONG( Reserved ); // Reserved--must be zero
  336. UCHAR Buffer[1]; // Directory name to create
  337. } REQ_CREATE_DIRECTORY2;
  338. typedef REQ_CREATE_DIRECTORY2 SMB_UNALIGNED *PREQ_CREATE_DIRECTORY2;
  339. // Data bytes for CreateDirectory2 request are the extended attributes for the
  340. // created file.
  341. typedef struct _RESP_CREATE_DIRECTORY2 {
  342. _USHORT( EaErrorOffset ); // Offset into FEAList of first error
  343. // which occurred while setting EAs
  344. } RESP_CREATE_DIRECTORY2;
  345. typedef RESP_CREATE_DIRECTORY2 SMB_UNALIGNED *PRESP_CREATE_DIRECTORY2;
  346. #endif // def INCLUDE_SMB_DIRECTORY
  347. #ifdef INCLUDE_SMB_SEARCH
  348. //
  349. // FindFirst2 function code of Transaction2 SMB, see #3 page 22
  350. // Function is SrvSmbFindFirst2()
  351. // TRANS2_FIND_FIRST2 0x01
  352. //
  353. typedef struct _REQ_FIND_FIRST2 {
  354. _USHORT( SearchAttributes );
  355. _USHORT( SearchCount ); // Maximum number of entries to return
  356. _USHORT( Flags ); // Additional information: bit set-
  357. // 0 - close search after this request
  358. // 1 - close search if end reached
  359. // 2 - return resume keys
  360. _USHORT( InformationLevel );
  361. _ULONG(SearchStorageType);
  362. UCHAR Buffer[1]; // File name
  363. } REQ_FIND_FIRST2;
  364. typedef REQ_FIND_FIRST2 SMB_UNALIGNED *PREQ_FIND_FIRST2;
  365. // Data bytes for Find First2 request are a list of extended attributes
  366. // to retrieve (a GEAList), if InformationLevel is QUERY_EAS_FROM_LIST.
  367. typedef struct _RESP_FIND_FIRST2 {
  368. _USHORT( Sid ); // Search handle
  369. _USHORT( SearchCount ); // Number of entries returned
  370. _USHORT( EndOfSearch ); // Was last entry returned?
  371. _USHORT( EaErrorOffset ); // Offset into EA list if EA error
  372. _USHORT( LastNameOffset ); // Offset into data to file name of
  373. // last entry, if server needs it
  374. // to resume search; else 0
  375. } RESP_FIND_FIRST2;
  376. typedef RESP_FIND_FIRST2 SMB_UNALIGNED *PRESP_FIND_FIRST2;
  377. // Data bytes for Find First2 response are level-dependent information
  378. // about the matching files. If bit 2 in the request parameters was
  379. // set, each entry is preceded by a four-byte resume key.
  380. //
  381. // FindNext2 function code of Transaction2 SMB, see #3 page 26
  382. // Function is SrvSmbFindNext2()
  383. // TRANS2_FIND_NEXT2 0x02
  384. //
  385. typedef struct _REQ_FIND_NEXT2 {
  386. _USHORT( Sid ); // Search handle
  387. _USHORT( SearchCount ); // Maximum number of entries to return
  388. _USHORT( InformationLevel );
  389. _ULONG( ResumeKey ); // Value returned by previous find
  390. _USHORT( Flags ); // Additional information: bit set-
  391. // 0 - close search after this request
  392. // 1 - close search if end reached
  393. // 2 - return resume keys
  394. // 3 - resume/continue, NOT rewind
  395. UCHAR Buffer[1]; // Resume file name
  396. } REQ_FIND_NEXT2;
  397. typedef REQ_FIND_NEXT2 SMB_UNALIGNED *PREQ_FIND_NEXT2;
  398. // Data bytes for Find Next2 request are a list of extended attributes
  399. // to retrieve, if InformationLevel is QUERY_EAS_FROM_LIST.
  400. typedef struct _RESP_FIND_NEXT2 {
  401. _USHORT( SearchCount ); // Number of entries returned
  402. _USHORT( EndOfSearch ); // Was last entry returned?
  403. _USHORT( EaErrorOffset ); // Offset into EA list if EA error
  404. _USHORT( LastNameOffset ); // Offset into data to file name of
  405. // last entry, if server needs it
  406. // to resume search; else 0
  407. } RESP_FIND_NEXT2;
  408. typedef RESP_FIND_NEXT2 SMB_UNALIGNED *PRESP_FIND_NEXT2;
  409. // Data bytes for Find Next2 response are level-dependent information
  410. // about the matching files. If bit 2 in the request parameters was
  411. // set, each entry is preceded by a four-byte resume key.
  412. //
  413. // Flags for REQ_FIND_FIRST2.Flags
  414. //
  415. #define SMB_FIND_CLOSE_AFTER_REQUEST 0x01
  416. #define SMB_FIND_CLOSE_AT_EOS 0x02
  417. #define SMB_FIND_RETURN_RESUME_KEYS 0x04
  418. #define SMB_FIND_CONTINUE_FROM_LAST 0x08
  419. #define SMB_FIND_WITH_BACKUP_INTENT 0x10
  420. #endif // def INCLUDE_SMB_SEARCH
  421. #ifdef INCLUDE_SMB_OPEN_CLOSE
  422. //
  423. // Open2 function code of Transaction2 SMB, see #3 page 19
  424. // Function is SrvSmbOpen2()
  425. // TRANS2_OPEN2 0x00
  426. //
  427. // *** Note that the REQ_OPEN2 and RESP_OPEN2 structures closely
  428. // resemble the REQ_OPEN_ANDX and RESP_OPEN_ANDX structures.
  429. //
  430. typedef struct _REQ_OPEN2 {
  431. _USHORT( Flags ); // Additional information: bit set-
  432. // 0 - return additional info
  433. // 1 - set single user total file lock
  434. // 2 - server notifies consumer of
  435. // actions which may change file
  436. // 3 - return total length of EAs
  437. _USHORT( DesiredAccess ); // File open mode
  438. _USHORT( SearchAttributes ); // *** ignored
  439. _USHORT( FileAttributes );
  440. _ULONG( CreationTimeInSeconds );
  441. _USHORT( OpenFunction );
  442. _ULONG( AllocationSize ); // Bytes to reserve on create or truncate
  443. _USHORT( Reserved )[5]; // Pad through OpenAndX's Timeout,
  444. // Reserved, and ByteCount
  445. UCHAR Buffer[1]; // File name
  446. } REQ_OPEN2;
  447. typedef REQ_OPEN2 SMB_UNALIGNED *PREQ_OPEN2;
  448. // Data bytes for Open2 request are the extended attributes for the
  449. // created file.
  450. typedef struct _RESP_OPEN2 {
  451. _USHORT( Fid ); // File handle
  452. _USHORT( FileAttributes );
  453. _ULONG( CreationTimeInSeconds );
  454. _ULONG( DataSize ); // Current file size
  455. _USHORT( GrantedAccess ); // Access permissions actually allowed
  456. _USHORT( FileType );
  457. _USHORT( DeviceState ); // state of IPC device (e.g. pipe)
  458. _USHORT( Action ); // Action taken
  459. _ULONG( ServerFid ); // Server unique file id
  460. _USHORT( EaErrorOffset ); // Offset into EA list if EA error
  461. _ULONG( EaLength ); // Total EA length for opened file
  462. } RESP_OPEN2;
  463. typedef RESP_OPEN2 SMB_UNALIGNED *PRESP_OPEN2;
  464. // The Open2 response has no data bytes.
  465. #endif // def INCLUDE_SMB_OPEN_CLOSE
  466. #ifdef INCLUDE_SMB_MISC
  467. //
  468. // QueryFsInformation function code of Transaction2 SMB, see #3 page 30
  469. // Function is SrvSmbQueryFsInformation()
  470. // TRANS2_QUERY_FS_INFORMATION 0x03
  471. //
  472. typedef struct _REQ_QUERY_FS_INFORMATION {
  473. _USHORT( InformationLevel );
  474. } REQ_QUERY_FS_INFORMATION;
  475. typedef REQ_QUERY_FS_INFORMATION SMB_UNALIGNED *PREQ_QUERY_FS_INFORMATION;
  476. // No data bytes for Query FS Information request.
  477. //typedef struct _RESP_QUERY_FS_INFORMATION {
  478. //} RESP_QUERY_FS_INFORMATION;
  479. //typedef RESP_QUERY_FS_INFORMATION SMB_UNALIGNED *PRESP_QUERY_FS_INFORMATION;
  480. // Data bytes for Query FS Information response are level-dependent
  481. // information about the specified volume.
  482. //
  483. // SetFSInformation function code of Transaction2 SMB, see #3 page 31
  484. // Function is SrvSmbSetFSInformation()
  485. // TRANS2_SET_PATH_INFORMATION 0x04
  486. //
  487. typedef struct _REQ_SET_FS_INFORMATION {
  488. _USHORT( Fid );
  489. _USHORT( InformationLevel );
  490. } REQ_SET_FS_INFORMATION;
  491. typedef REQ_SET_FS_INFORMATION SMB_UNALIGNED *PREQ_SET_FS_INFORMATION;
  492. // Data bytes for Set FS Information request are level-dependant
  493. // information about the specified volume.
  494. //typedef struct _RESP_SET_FS_INFORMATION {
  495. //} RESP_SET_FS_INFORMATION;
  496. //typedef RESP_SET_FS_INFORMATION SMB_UNALIGNED *PRESP_SET_FS_INFORMATION;
  497. // The Set FS Information response has no data bytes.
  498. #endif // def INCLUDE_SMB_MISC
  499. #ifdef INCLUDE_SMB_QUERY_SET
  500. //
  501. // QueryPathInformation function code of Transaction2 SMB, see #3 page 33
  502. // Function is SrvSmbQueryPathInformation()
  503. // TRANS2_QUERY_PATH_INFORMATION 0x05
  504. //
  505. typedef struct _REQ_QUERY_PATH_INFORMATION {
  506. _USHORT( InformationLevel );
  507. _ULONG( Reserved ); // Must be zero
  508. UCHAR Buffer[1]; // File name
  509. } REQ_QUERY_PATH_INFORMATION;
  510. typedef REQ_QUERY_PATH_INFORMATION SMB_UNALIGNED *PREQ_QUERY_PATH_INFORMATION;
  511. // Data bytes for Query Path Information request are a list of extended
  512. // attributes to retrieve, if InformationLevel is QUERY_EAS_FROM_LIST.
  513. typedef struct _RESP_QUERY_PATH_INFORMATION {
  514. _USHORT( EaErrorOffset ); // Offset into EA list if EA error
  515. } RESP_QUERY_PATH_INFORMATION;
  516. typedef RESP_QUERY_PATH_INFORMATION SMB_UNALIGNED *PRESP_QUERY_PATH_INFORMATION;
  517. // Data bytes for Query Path Information response are level-dependent
  518. // information about the specified path/file.
  519. //
  520. // SetPathInformation function code of Transaction2 SMB, see #3 page 35
  521. // Function is SrvSmbSetPathInformation()
  522. // TRANS2_SET_PATH_INFORMATION 0x06
  523. //
  524. typedef struct _REQ_SET_PATH_INFORMATION {
  525. _USHORT( InformationLevel );
  526. _ULONG( Reserved ); // Must be zero
  527. UCHAR Buffer[1]; // File name
  528. } REQ_SET_PATH_INFORMATION;
  529. typedef REQ_SET_PATH_INFORMATION SMB_UNALIGNED *PREQ_SET_PATH_INFORMATION;
  530. // Data bytes for Set Path Information request are either file information
  531. // and attributes or a list of extended attributes for the file.
  532. typedef struct _RESP_SET_PATH_INFORMATION {
  533. _USHORT( EaErrorOffset ); // Offset into EA list if EA error
  534. } RESP_SET_PATH_INFORMATION;
  535. typedef RESP_SET_PATH_INFORMATION SMB_UNALIGNED *PRESP_SET_PATH_INFORMATION;
  536. // The Set Path Information response has no data bytes.
  537. //
  538. // QueryFileInformation function code of Transaction2 SMB, see #3 page 37
  539. // Function is SrvSmbQueryFileInformation()
  540. // TRANS2_QUERY_FILE_INFORMATION 0x07
  541. //
  542. typedef struct _REQ_QUERY_FILE_INFORMATION {
  543. _USHORT( Fid ); // File handle
  544. _USHORT( InformationLevel );
  545. } REQ_QUERY_FILE_INFORMATION;
  546. typedef REQ_QUERY_FILE_INFORMATION SMB_UNALIGNED *PREQ_QUERY_FILE_INFORMATION;
  547. // Data bytes for Query File Information request are a list of extended
  548. // attributes to retrieve, if InformationLevel is QUERY_EAS_FROM_LIST.
  549. typedef struct _RESP_QUERY_FILE_INFORMATION {
  550. _USHORT( EaErrorOffset ); // Offset into EA list if EA error
  551. } RESP_QUERY_FILE_INFORMATION;
  552. typedef RESP_QUERY_FILE_INFORMATION SMB_UNALIGNED *PRESP_QUERY_FILE_INFORMATION;
  553. // Data bytes for Query File Information response are level-dependent
  554. // information about the specified path/file.
  555. //
  556. // SetFileInformation function code of Transaction2 SMB, see #3 page 39
  557. // Function is SrvSmbSetFileInformation()
  558. // TRANS2_SET_FILE_INFORMATION 0x08
  559. //
  560. typedef struct _REQ_SET_FILE_INFORMATION {
  561. _USHORT( Fid ); // File handle
  562. _USHORT( InformationLevel );
  563. _USHORT( Flags ); // File I/O control flags: bit set-
  564. // 4 - write through
  565. // 5 - no cache
  566. } REQ_SET_FILE_INFORMATION;
  567. typedef REQ_SET_FILE_INFORMATION SMB_UNALIGNED *PREQ_SET_FILE_INFORMATION;
  568. // Data bytes for Set File Information request are either file information
  569. // and attributes or a list of extended attributes for the file.
  570. typedef struct _RESP_SET_FILE_INFORMATION {
  571. _USHORT( EaErrorOffset ); // Offset into EA list if EA error
  572. } RESP_SET_FILE_INFORMATION;
  573. typedef RESP_SET_FILE_INFORMATION SMB_UNALIGNED *PRESP_SET_FILE_INFORMATION;
  574. // The Set File Information response has no data bytes.
  575. #endif // def INCLUDE_SMB_QUERY_SET
  576. //
  577. // Opcodes for Mailslot transactions. Not all filled in at present.
  578. // WARNING ... the info here on mailslots (opcode and smb struct)
  579. // is duplicated in net/h/mslotsmb.h
  580. //
  581. #define MS_WRITE_OPCODE 1
  582. typedef struct _SMB_TRANSACT_MAILSLOT {
  583. UCHAR WordCount; // Count of data bytes; value = 17
  584. _USHORT( TotalParameterCount ); // Total parameter bytes being sent
  585. _USHORT( TotalDataCount ); // Total data bytes being sent
  586. _USHORT( MaxParameterCount ); // Max parameter bytes to return
  587. _USHORT( MaxDataCount ); // Max data bytes to return
  588. UCHAR MaxSetupCount; // Max setup words to return
  589. UCHAR Reserved;
  590. _USHORT( Flags ); // Additional information:
  591. // bit 0 - unused
  592. // bit 1 - one-way transacion (no resp)
  593. _ULONG( Timeout );
  594. _USHORT( Reserved1 );
  595. _USHORT( ParameterCount ); // Parameter bytes sent this buffer
  596. _USHORT( ParameterOffset ); // Offset (from header start) to params
  597. _USHORT( DataCount ); // Data bytes sent this buffer
  598. _USHORT( DataOffset ); // Offset (from header start) to data
  599. UCHAR SetupWordCount; // = 3
  600. UCHAR Reserved2; // Reserved (pad above to word)
  601. _USHORT( Opcode ); // 1 -- Write Mailslot
  602. _USHORT( Priority ); // Priority of transaction
  603. _USHORT( Class ); // Class: 1 = reliable, 2 = unreliable
  604. _USHORT( ByteCount ); // Count of data bytes
  605. UCHAR Buffer[1]; // Buffer containing:
  606. //UCHAR MailslotName[]; // "\MAILSLOT\<name>0"
  607. //UCHAR Pad[] // Pad to SHORT or LONG
  608. //UCHAR Data[]; // Data to write to mailslot
  609. } SMB_TRANSACT_MAILSLOT;
  610. typedef SMB_TRANSACT_MAILSLOT SMB_UNALIGNED *PSMB_TRANSACT_MAILSLOT;
  611. typedef struct _SMB_TRANSACT_NAMED_PIPE {
  612. UCHAR WordCount; // Count of data bytes; value = 16
  613. _USHORT( TotalParameterCount ); // Total parameter bytes being sent
  614. _USHORT( TotalDataCount ); // Total data bytes being sent
  615. _USHORT( MaxParameterCount ); // Max parameter bytes to return
  616. _USHORT( MaxDataCount ); // Max data bytes to return
  617. UCHAR MaxSetupCount; // Max setup words to return
  618. UCHAR Reserved;
  619. _USHORT( Flags ); // Additional information:
  620. // bit 0 - also disconnect TID in Tid
  621. // bit 1 - one-way transacion (no resp)
  622. _ULONG( Timeout );
  623. _USHORT( Reserved1 );
  624. _USHORT( ParameterCount );
  625. // Buffer containing:
  626. //UCHAR PipeName[]; // "\PIPE\<name>0"
  627. //UCHAR Pad[] // Pad to SHORT or LONG
  628. //UCHAR Param[]; // Parameter bytes (# = ParameterCount)
  629. //UCHAR Pad1[] // Pad to SHORT or LONG
  630. //UCHAR Data[]; // Data bytes (# = DataCount)
  631. } SMB_TRANSACT_NAMED_PIPE;
  632. typedef SMB_TRANSACT_NAMED_PIPE SMB_UNALIGNED *PSMB_TRANSACT_NAMED_PIPE;
  633. //
  634. // Transaction - QueryInformationNamedPipe, Level 1, output data format
  635. //
  636. typedef struct _NAMED_PIPE_INFORMATION_1 {
  637. _USHORT( OutputBufferSize );
  638. _USHORT( InputBufferSize );
  639. UCHAR MaximumInstances;
  640. UCHAR CurrentInstances;
  641. UCHAR PipeNameLength;
  642. UCHAR PipeName[1];
  643. } NAMED_PIPE_INFORMATION_1;
  644. typedef NAMED_PIPE_INFORMATION_1 SMB_UNALIGNED *PNAMED_PIPE_INFORMATION_1;
  645. //
  646. // Transaction - PeekNamedPipe, output format
  647. //
  648. typedef struct _RESP_PEEK_NMPIPE {
  649. _USHORT( ReadDataAvailable );
  650. _USHORT( MessageLength );
  651. _USHORT( NamedPipeState );
  652. //UCHAR Pad[];
  653. //UCHAR Data[];
  654. } RESP_PEEK_NMPIPE;
  655. typedef RESP_PEEK_NMPIPE SMB_UNALIGNED *PRESP_PEEK_NMPIPE;
  656. //
  657. // Define SMB pipe handle state bits used by Query/SetNamedPipeHandleState
  658. //
  659. // These number are the bit location of the fields in the handle state.
  660. //
  661. #define PIPE_COMPLETION_MODE_BITS 15
  662. #define PIPE_PIPE_END_BITS 14
  663. #define PIPE_PIPE_TYPE_BITS 10
  664. #define PIPE_READ_MODE_BITS 8
  665. #define PIPE_MAXIMUM_INSTANCES_BITS 0
  666. /* DosPeekNmPipe() pipe states */
  667. #define PIPE_STATE_DISCONNECTED 0x0001
  668. #define PIPE_STATE_LISTENING 0x0002
  669. #define PIPE_STATE_CONNECTED 0x0003
  670. #define PIPE_STATE_CLOSING 0x0004
  671. /* DosCreateNPipe and DosQueryNPHState state */
  672. #define SMB_PIPE_READMODE_BYTE 0x0000
  673. #define SMB_PIPE_READMODE_MESSAGE 0x0100
  674. #define SMB_PIPE_TYPE_BYTE 0x0000
  675. #define SMB_PIPE_TYPE_MESSAGE 0x0400
  676. #define SMB_PIPE_END_CLIENT 0x0000
  677. #define SMB_PIPE_END_SERVER 0x4000
  678. #define SMB_PIPE_WAIT 0x0000
  679. #define SMB_PIPE_NOWAIT 0x8000
  680. #define SMB_PIPE_UNLIMITED_INSTANCES 0x00FF
  681. //
  682. // Pipe name string for conversion between SMB and NT formats.
  683. //
  684. #define SMB_PIPE_PREFIX "\\PIPE"
  685. #define UNICODE_SMB_PIPE_PREFIX L"\\PIPE"
  686. #define CANONICAL_PIPE_PREFIX "PIPE\\"
  687. #define NT_PIPE_PREFIX L"\\Device\\NamedPipe"
  688. #define SMB_PIPE_PREFIX_LENGTH (sizeof(SMB_PIPE_PREFIX) - 1)
  689. #define UNICODE_SMB_PIPE_PREFIX_LENGTH \
  690. (sizeof(UNICODE_SMB_PIPE_PREFIX) - sizeof(WCHAR))
  691. #define CANONICAL_PIPE_PREFIX_LENGTH (sizeof(CANONICAL_PIPE_PREFIX) - 1)
  692. #define NT_PIPE_PREFIX_LENGTH (sizeof(NT_PIPE_PREFIX) - sizeof(WCHAR))
  693. //
  694. // Mailslot name strings.
  695. //
  696. #define SMB_MAILSLOT_PREFIX "\\MAILSLOT"
  697. #define UNICODE_SMB_MAILSLOT_PREFIX L"\\MAILSLOT"
  698. #define SMB_MAILSLOT_PREFIX_LENGTH (sizeof(SMB_MAILSLOT_PREFIX) - 1)
  699. #define UNICODE_SMB_MAILSLOT_PREFIX_LENGTH \
  700. (sizeof(UNICODE_SMB_MAILSLOT_PREFIX) - sizeof(WCHAR))
  701. //
  702. // NT Transaction subfunctions
  703. //
  704. #ifdef INCLUDE_SMB_OPEN_CLOSE
  705. typedef struct _REQ_CREATE_WITH_SD_OR_EA {
  706. _ULONG( Flags ); // Creation flags NT_CREATE_xxx
  707. _ULONG( RootDirectoryFid ); // Optional directory for relative open
  708. ACCESS_MASK DesiredAccess; // Desired access (NT format)
  709. LARGE_INTEGER AllocationSize; // The initial allocation size in bytes
  710. _ULONG( FileAttributes ); // The file attributes
  711. _ULONG( ShareAccess ); // The share access
  712. _ULONG( CreateDisposition ); // Action to take if file exists or not
  713. _ULONG( CreateOptions ); // Options for creating a new file
  714. _ULONG( SecurityDescriptorLength );// Length of SD in bytes
  715. _ULONG( EaLength ); // Length of EA in bytes
  716. _ULONG( NameLength ); // Length of name in characters
  717. _ULONG( ImpersonationLevel ); // Security QOS information
  718. UCHAR SecurityFlags; // Security QOS information
  719. UCHAR Buffer[1];
  720. //UCHAR Name[]; // The name of the file (not NUL terminated)
  721. } REQ_CREATE_WITH_SD_OR_EA;
  722. typedef REQ_CREATE_WITH_SD_OR_EA SMB_UNALIGNED *PREQ_CREATE_WITH_SD_OR_EA;
  723. //
  724. // Data format:
  725. // UCHAR SecurityDesciptor[];
  726. // UCHAR Pad1[]; // Pad to LONG
  727. // UCHAR EaList[];
  728. //
  729. typedef struct _RESP_CREATE_WITH_SD_OR_EA {
  730. UCHAR OplockLevel; // The oplock level granted
  731. union {
  732. UCHAR Reserved;
  733. UCHAR ExtendedResponse; // set to zero for standard response
  734. };
  735. _USHORT( Fid ); // The file ID
  736. _ULONG( CreateAction ); // The action taken
  737. _ULONG( EaErrorOffset ); // Offset of the EA error
  738. TIME CreationTime; // The time the file was created
  739. TIME LastAccessTime; // The time the file was accessed
  740. TIME LastWriteTime; // The time the file was last written
  741. TIME ChangeTime; // The time the file was last changed
  742. _ULONG( FileAttributes ); // The file attributes
  743. LARGE_INTEGER AllocationSize; // The number of byes allocated
  744. LARGE_INTEGER EndOfFile; // The end of file offset
  745. _USHORT( FileType );
  746. _USHORT( DeviceState ); // state of IPC device (e.g. pipe)
  747. BOOLEAN Directory; // TRUE if this is a directory
  748. } RESP_CREATE_WITH_SD_OR_EA;
  749. typedef RESP_CREATE_WITH_SD_OR_EA SMB_UNALIGNED *PRESP_CREATE_WITH_SD_OR_EA;
  750. // No data bytes for the response
  751. typedef struct _RESP_EXTENDED_CREATE_WITH_SD_OR_EA {
  752. UCHAR OplockLevel; // The oplock level granted
  753. UCHAR ExtendedResponse; // set to 1 for Extended response
  754. _USHORT( Fid ); // The file ID
  755. _ULONG( CreateAction ); // The action taken
  756. _ULONG( EaErrorOffset ); // Offset of the EA error
  757. TIME CreationTime; // The time the file was created
  758. TIME LastAccessTime; // The time the file was accessed
  759. TIME LastWriteTime; // The time the file was last written
  760. TIME ChangeTime; // The time the file was last changed
  761. _ULONG( FileAttributes ); // The file attributes
  762. LARGE_INTEGER AllocationSize; // The number of byes allocated
  763. LARGE_INTEGER EndOfFile; // The end of file offset
  764. _USHORT( FileType );
  765. _USHORT( DeviceState ); // state of IPC device (e.g. pipe)
  766. BOOLEAN Directory; // TRUE if this is a directory
  767. UCHAR VolumeGuid[16]; // the volume GUID
  768. UCHAR FileId[8]; // the file id
  769. _ULONG ( MaximalAccessRights ); // the access rights for the session owner
  770. _ULONG ( GuestMaximalAccessRights ); // the maximal access rights for guest
  771. } RESP_EXTENDED_CREATE_WITH_SD_OR_EA;
  772. typedef RESP_EXTENDED_CREATE_WITH_SD_OR_EA SMB_UNALIGNED *PRESP_EXTENDED_CREATE_WITH_SD_OR_EA;
  773. #ifdef INCLUDE_SMB_IFMODIFIED
  774. typedef struct _RESP_EXTENDED_CREATE_WITH_SD_OR_EA2 {
  775. UCHAR OplockLevel; // The oplock level granted
  776. UCHAR ExtendedResponse; // set to 1 for Extended response
  777. _USHORT( Fid ); // The file ID
  778. _ULONG( CreateAction ); // The action taken
  779. _ULONG( EaErrorOffset ); // Offset of the EA error
  780. TIME CreationTime; // The time the file was created
  781. TIME LastAccessTime; // The time the file was accessed
  782. TIME LastWriteTime; // The time the file was last written
  783. TIME ChangeTime; // The time the file was last changed
  784. _ULONG( FileAttributes ); // The file attributes
  785. LARGE_INTEGER AllocationSize; // The number of byes allocated
  786. LARGE_INTEGER EndOfFile; // The end of file offset
  787. _USHORT( FileType );
  788. _USHORT( DeviceState ); // state of IPC device (e.g. pipe)
  789. BOOLEAN Directory; // TRUE if this is a directory
  790. UCHAR VolumeGuid[16]; // the volume GUID
  791. UCHAR FileId[8]; // the file id
  792. _ULONG ( MaximalAccessRights ); // the access rights for the session owner
  793. _ULONG ( GuestMaximalAccessRights ); // the maximal access rights for guest
  794. // below here is where it differs from RESP_EXTENDED_CREATE_WITH_SD_OR_EA
  795. LARGE_INTEGER UsnValue; // The file's USN # in NTFS
  796. LARGE_INTEGER FileReferenceNumber; //
  797. WCHAR ShortName[13]; // if not present, empty string.
  798. _USHORT( ByteCount ); // length of long name
  799. WCHAR Buffer[1]; // long name goes here
  800. } RESP_EXTENDED_CREATE_WITH_SD_OR_EA2;
  801. typedef RESP_EXTENDED_CREATE_WITH_SD_OR_EA2 SMB_UNALIGNED *PRESP_EXTENDED_CREATE_WITH_SD_OR_EA2;
  802. #endif // def INCLUDE_SMB_IFMODIFIED
  803. // No data bytes for the response
  804. #endif // INCLUDE_SMB_OPEN_CLOSE
  805. //
  806. // Setup words for NT I/O control request
  807. //
  808. typedef struct _REQ_NT_IO_CONTROL {
  809. _ULONG( FunctionCode );
  810. _USHORT( Fid );
  811. BOOLEAN IsFsctl;
  812. UCHAR IsFlags;
  813. } REQ_NT_IO_CONTROL;
  814. typedef REQ_NT_IO_CONTROL SMB_UNALIGNED *PREQ_NT_IO_CONTROL;
  815. //
  816. // Request parameter bytes - The first buffer
  817. // Request data bytes - The second buffer
  818. //
  819. //
  820. // NT I/O Control response:
  821. //
  822. // Setup Words: None.
  823. // Parameter Bytes: First buffer.
  824. // Data Bytes: Second buffer.
  825. //
  826. //
  827. // NT Notify directory change
  828. //
  829. // Request Setup Words
  830. typedef struct _REQ_NOTIFY_CHANGE {
  831. _ULONG( CompletionFilter ); // Specifies operation to monitor
  832. _USHORT( Fid ); // Fid of directory to monitor
  833. BOOLEAN WatchTree; // TRUE = watch all subdirectories too
  834. UCHAR Reserved; // MBZ
  835. } REQ_NOTIFY_CHANGE;
  836. typedef REQ_NOTIFY_CHANGE SMB_UNALIGNED *PREQ_NOTIFY_CHANGE;
  837. //
  838. // Request parameter bytes: None
  839. // Request data bytes: None
  840. //
  841. //
  842. // NT Notify directory change response
  843. //
  844. // Setup words: None.
  845. // Parameter bytes: The change data buffer.
  846. // Data bytes: None.
  847. //
  848. //
  849. // NT Set Security Descriptor request
  850. //
  851. // Setup words: REQ_SET_SECURITY_DESCIPTOR.
  852. // Parameter Bytes: None.
  853. // Data Bytes: The Security Descriptor data.
  854. //
  855. typedef struct _REQ_SET_SECURITY_DESCRIPTOR {
  856. _USHORT( Fid ); // FID of target
  857. _USHORT( Reserved ); // MBZ
  858. _ULONG( SecurityInformation ); // Fields of SD that to set
  859. } REQ_SET_SECURITY_DESCRIPTOR;
  860. typedef REQ_SET_SECURITY_DESCRIPTOR SMB_UNALIGNED *PREQ_SET_SECURITY_DESCRIPTOR;
  861. //
  862. // NT Set Security Desciptor response
  863. //
  864. // Setup words: None.
  865. // Parameter Bytes: None.
  866. // Data Bytes: None.
  867. //
  868. //
  869. // NT Query Security Descriptor request
  870. //
  871. // Setup words: None.
  872. // Parameter Bytes: REQ_QUERY_SECURITY_DESCRIPTOR.
  873. // Data Bytes: None.
  874. //
  875. typedef struct _REQ_QUERY_SECURITY_DESCRIPTOR {
  876. _USHORT( Fid ); // FID of target
  877. _USHORT( Reserved ); // MBZ
  878. _ULONG( SecurityInformation ); // Fields of SD that to query
  879. } REQ_QUERY_SECURITY_DESCRIPTOR;
  880. typedef REQ_QUERY_SECURITY_DESCRIPTOR SMB_UNALIGNED *PREQ_QUERY_SECURITY_DESCRIPTOR;
  881. //
  882. // NT Query Security Desciptor response
  883. //
  884. // Parameter bytes: RESP_QUERY_SECURITY_DESCRIPTOR
  885. // Data Bytes: The Security Descriptor data.
  886. //
  887. typedef struct _RESP_QUERY_SECURITY_DESCRIPTOR {
  888. _ULONG( LengthNeeded ); // Size of data buffer required for SD
  889. } RESP_QUERY_SECURITY_DESCRIPTOR;
  890. typedef RESP_QUERY_SECURITY_DESCRIPTOR SMB_UNALIGNED *PRESP_QUERY_SECURITY_DESCRIPTOR;
  891. //
  892. // NT Rename file
  893. //
  894. // Setup words: None
  895. // Parameters bytes: REQ_NT_RENAME
  896. // Data bytes: None
  897. //
  898. typedef struct _REQ_NT_RENAME {
  899. _USHORT( Fid ); // FID of file to rename
  900. _USHORT( RenameFlags ); // defined below
  901. UCHAR NewName[]; // New file name.
  902. } REQ_NT_RENAME;
  903. typedef REQ_NT_RENAME SMB_UNALIGNED *PREQ_NT_RENAME;
  904. //
  905. // Rename flags defined
  906. //
  907. #define SMB_RENAME_REPLACE_IF_EXISTS 1
  908. //
  909. // Turn structure packing back off
  910. //
  911. #ifndef NO_PACKING
  912. #include <packoff.h>
  913. #endif // ndef NO_PACKING
  914. #endif // ndef _SMBTRANS_