1 /* 2 Unix SMB/Netbios implementation. 3 Version 1.9. 4 SMB transaction2 handling 5 */ 6 7 #ifndef _TRANS2_H_ 8 #define _TRANS2_H_ 9 10 /* Define the structures needed for the trans2 calls. */ 11 12 /******************************************************* 13 For DosFindFirst/DosFindNext - level 1 14 15 MAXFILENAMELEN = 255; 16 FDATE == uint16 17 FTIME == uint16 18 ULONG == uint32 19 USHORT == uint16 20 21 typedef struct _FILEFINDBUF { 22 Byte offset Type name description 23 -------------+-------+-------------------+-------------- 24 0 FDATE fdateCreation; 25 2 FTIME ftimeCreation; 26 4 FDATE fdateLastAccess; 27 6 FTIME ftimeLastAccess; 28 8 FDATE fdateLastWrite; 29 10 FTIME ftimeLastWrite; 30 12 ULONG cbFile file length in bytes 31 16 ULONG cbFileAlloc size of file allocation unit 32 20 USHORT attrFile 33 22 UCHAR cchName length of name to follow (not including zero) 34 23 UCHAR achName[MAXFILENAMELEN]; Null terminated name 35 } FILEFINDBUF; 36 *********************************************************/ 37 38 #define l1_fdateCreation 0 39 #define l1_fdateLastAccess 4 40 #define l1_fdateLastWrite 8 41 #define l1_cbFile 12 42 #define l1_cbFileAlloc 16 43 #define l1_attrFile 20 44 #define l1_cchName 22 45 #define l1_achName 23 46 47 /********************************************************** 48 For DosFindFirst/DosFindNext - level 2 49 50 typedef struct _FILEFINDBUF2 { 51 Byte offset Type name description 52 -------------+-------+-------------------+-------------- 53 0 FDATE fdateCreation; 54 2 FTIME ftimeCreation; 55 4 FDATE fdateLastAccess; 56 6 FTIME ftimeLastAccess; 57 8 FDATE fdateLastWrite; 58 10 FTIME ftimeLastWrite; 59 12 ULONG cbFile file length in bytes 60 16 ULONG cbFileAlloc size of file allocation unit 61 20 USHORT attrFile 62 22 ULONG cbList Extended attribute list (always 0) 63 26 UCHAR cchName length of name to follow (not including zero) 64 27 UCHAR achName[MAXFILENAMELEN]; Null terminated name 65 } FILEFINDBUF2; 66 *************************************************************/ 67 68 #define l2_fdateCreation 0 69 #define l2_fdateLastAccess 4 70 #define l2_fdateLastWrite 8 71 #define l2_cbFile 12 72 #define l2_cbFileAlloc 16 73 #define l2_attrFile 20 74 #define l2_cbList 22 75 #define l2_cchName 26 76 #define l2_achName 27 77 78 79 /********************************************************** 80 For DosFindFirst/DosFindNext - level 260 81 82 typedef struct _FILEFINDBUF260 { 83 Byte offset Type name description 84 -------------+-------+-------------------+-------------- 85 0 ULONG NextEntryOffset; 86 4 ULONG FileIndex; 87 8 LARGE_INTEGER CreationTime; 88 16 LARGE_INTEGER LastAccessTime; 89 24 LARGE_INTEGER LastWriteTime; 90 32 LARGE_INTEGER ChangeTime; 91 40 LARGE_INTEGER EndOfFile; 92 48 LARGE_INTEGER AllocationSize; 93 56 ULONG FileAttributes; 94 60 ULONG FileNameLength; 95 64 ULONG EaSize; 96 68 CHAR ShortNameLength; 97 70 UNICODE ShortName[12]; 98 94 UNICODE FileName[]; 99 *************************************************************/ 100 101 #define l260_achName 94 102 103 104 /********************************************************** 105 For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/ 106 DosSetFileInfo - level 1 107 108 typedef struct _FILESTATUS { 109 Byte offset Type name description 110 -------------+-------+-------------------+-------------- 111 0 FDATE fdateCreation; 112 2 FTIME ftimeCreation; 113 4 FDATE fdateLastAccess; 114 6 FTIME ftimeLastAccess; 115 8 FDATE fdateLastWrite; 116 10 FTIME ftimeLastWrite; 117 12 ULONG cbFile file length in bytes 118 16 ULONG cbFileAlloc size of file allocation unit 119 20 USHORT attrFile 120 } FILESTATUS; 121 *************************************************************/ 122 123 /* Use the l1_ defines from DosFindFirst */ 124 125 /********************************************************** 126 For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/ 127 DosSetFileInfo - level 2 128 129 typedef struct _FILESTATUS2 { 130 Byte offset Type name description 131 -------------+-------+-------------------+-------------- 132 0 FDATE fdateCreation; 133 2 FTIME ftimeCreation; 134 4 FDATE fdateLastAccess; 135 6 FTIME ftimeLastAccess; 136 8 FDATE fdateLastWrite; 137 10 FTIME ftimeLastWrite; 138 12 ULONG cbFile file length in bytes 139 16 ULONG cbFileAlloc size of file allocation unit 140 20 USHORT attrFile 141 22 ULONG cbList Length of EA's (0) 142 } FILESTATUS2; 143 *************************************************************/ 144 145 /* Use the l2_ #defines from DosFindFirst */ 146 147 /********************************************************** 148 For DosQFSInfo/DosSetFSInfo - level 1 149 150 typedef struct _FSALLOCATE { 151 Byte offset Type name description 152 -------------+-------+-------------------+-------------- 153 0 ULONG idFileSystem id of file system 154 4 ULONG cSectorUnit number of sectors per allocation unit 155 8 ULONG cUnit number of allocation units 156 12 ULONG cUnitAvail Available allocation units 157 16 USHORT cbSector bytes per sector 158 } FSALLOCATE; 159 *************************************************************/ 160 161 #define l1_idFileSystem 0 162 #define l1_cSectorUnit 4 163 #define l1_cUnit 8 164 #define l1_cUnitAvail 12 165 #define l1_cbSector 16 166 167 /********************************************************** 168 For DosQFSInfo/DosSetFSInfo - level 2 169 170 typedef struct _FSINFO { 171 Byte offset Type name description 172 -------------+-------+-------------------+-------------- 173 0 FDATE vol_fdateCreation 174 2 FTIME vol_ftimeCreation 175 4 UCHAR vol_cch length of volume name (excluding NULL) 176 5 UCHAR vol_szVolLabel[12] volume name 177 } FSINFO; 178 *************************************************************/ 179 180 #define SMB_INFO_STANDARD 1 181 #define SMB_INFO_QUERY_EA_SIZE 2 182 #define SMB_INFO_QUERY_EAS_FROM_LIST 3 183 #define SMB_INFO_QUERY_ALL_EAS 4 184 #define SMB_INFO_IS_NAME_VALID 6 185 #define SMB_QUERY_FS_LABEL_INFO 0x101 186 #define SMB_QUERY_FS_VOLUME_INFO 0x102 187 #define SMB_QUERY_FS_SIZE_INFO 0x103 188 #define SMB_QUERY_FS_DEVICE_INFO 0x104 189 #define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105 190 191 192 #define l2_vol_fdateCreation 0 193 #define l2_vol_cch 4 194 #define l2_vol_szVolLabel 5 195 196 197 #define SMB_QUERY_FILE_BASIC_INFO 0x101 198 #define SMB_QUERY_FILE_STANDARD_INFO 0x102 199 #define SMB_QUERY_FILE_EA_INFO 0x103 200 #define SMB_QUERY_FILE_NAME_INFO 0x104 201 #define SMB_QUERY_FILE_ALLOCATION_INFO 0x105 202 #define SMB_QUERY_FILE_END_OF_FILEINFO 0x106 203 #define SMB_QUERY_FILE_ALL_INFO 0x107 204 #define SMB_QUERY_FILE_ALT_NAME_INFO 0x108 205 #define SMB_QUERY_FILE_STREAM_INFO 0x109 206 207 #define SMB_FIND_FILE_DIRECTORY_INFO 0x101 208 #define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102 209 #define SMB_FIND_FILE_NAMES_INFO 0x103 210 #define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104 211 212 #define SMB_SET_FILE_BASIC_INFO 0x101 213 #define SMB_SET_FILE_DISPOSITION_INFO 0x102 214 #define SMB_SET_FILE_ALLOCATION_INFO 0x103 215 #define SMB_SET_FILE_END_OF_FILE_INFO 0x104 216 217 /* 218 * Thursby MAC extensions.... 219 */ 220 221 #define SMB_MAC_QUERY_FS_INFO 0x301 222 223 #define DIRLEN_GUESS (45+MAX(l1_achName,l2_achName)) 224 225 /* 226 * DeviceType and Characteristics returned in a 227 * SMB_QUERY_FS_DEVICE_INFO call. 228 */ 229 230 #define DEVICETYPE_CD_ROM 0x2 231 #define DEVICETYPE_CD_ROM_FILE_SYSTEM 0x3 232 #define DEVICETYPE_DISK 0x7 233 #define DEVICETYPE_DISK_FILE_SYSTEM 0x8 234 #define DEVICETYPE_FILE_SYSTEM 0x9 235 236 /* Characteristics. */ 237 #define TYPE_REMOVABLE_MEDIA 0x1 238 #define TYPE_READ_ONLY_DEVICE 0x2 239 #define TYPE_FLOPPY 0x4 240 #define TYPE_WORM 0x8 241 #define TYPE_REMOTE 0x10 242 #define TYPE_MOUNTED 0x20 243 #define TYPE_VIRTUAL 0x40 244 245 #endif 246