1 /* NFSv4.1 client for Windows 2 * Copyright � 2012 The Regents of the University of Michigan 3 * 4 * Olga Kornievskaia <aglo@umich.edu> 5 * Casey Bodley <cbodley@umich.edu> 6 * 7 * This library is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU Lesser General Public License as published by 9 * the Free Software Foundation; either version 2.1 of the License, or (at 10 * your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, but 13 * without any warranty; without even the implied warranty of merchantability 14 * or fitness for a particular purpose. See the GNU Lesser General Public 15 * License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public License 18 * along with this library; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 20 */ 21 22 #ifndef _NFS41_DAEMON_ 23 #define _NFS41_DAEMON_ 24 25 #define FILE_DIRECTORY_FILE 0x00000001 26 #define FILE_WRITE_THROUGH 0x00000002 27 #define FILE_SEQUENTIAL_ONLY 0x00000004 28 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008 29 30 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 31 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 32 #define FILE_NON_DIRECTORY_FILE 0x00000040 33 #define FILE_CREATE_TREE_CONNECTION 0x00000080 34 35 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100 36 #define FILE_NO_EA_KNOWLEDGE 0x00000200 37 #define FILE_OPEN_REMOTE_INSTANCE 0x00000400 38 #define FILE_RANDOM_ACCESS 0x00000800 39 40 #define FILE_DELETE_ON_CLOSE 0x00001000 41 #define FILE_OPEN_BY_FILE_ID 0x00002000 42 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000 43 #define FILE_NO_COMPRESSION 0x00008000 44 45 #define FILE_RESERVE_OPFILTER 0x00100000 46 #define FILE_OPEN_REPARSE_POINT 0x00200000 47 #define FILE_OPEN_NO_RECALL 0x00400000 48 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 49 50 #define FILE_COPY_STRUCTURED_STORAGE 0x00000041 51 #define FILE_STRUCTURED_STORAGE 0x00000441 52 53 #define FILE_SUPERSEDE 0x00000000 54 #define FILE_OPEN 0x00000001 55 #define FILE_CREATE 0x00000002 56 #define FILE_OPEN_IF 0x00000003 57 #define FILE_OVERWRITE 0x00000004 58 #define FILE_OVERWRITE_IF 0x00000005 59 #define FILE_MAXIMUM_DISPOSITION 0x00000005 60 61 typedef enum _FILE_INFORMATION_CLASS { 62 FileDirectoryInformation = 1, 63 FileFullDirectoryInformation, // 2 64 FileBothDirectoryInformation, // 3 65 FileBasicInformation, // 4 66 FileStandardInformation, // 5 67 FileInternalInformation, // 6 68 FileEaInformation, // 7 69 FileAccessInformation, // 8 70 FileNameInformation, // 9 71 FileRenameInformation, // 10 72 FileLinkInformation, // 11 73 FileNamesInformation, // 12 74 FileDispositionInformation, // 13 75 FilePositionInformation, // 14 76 FileFullEaInformation, // 15 77 FileModeInformation, // 16 78 FileAlignmentInformation, // 17 79 FileAllInformation, // 18 80 FileAllocationInformation, // 19 81 FileEndOfFileInformation, // 20 82 FileAlternateNameInformation, // 21 83 FileStreamInformation, // 22 84 FilePipeInformation, // 23 85 FilePipeLocalInformation, // 24 86 FilePipeRemoteInformation, // 25 87 FileMailslotQueryInformation, // 26 88 FileMailslotSetInformation, // 27 89 FileCompressionInformation, // 28 90 FileObjectIdInformation, // 29 91 FileCompletionInformation, // 30 92 FileMoveClusterInformation, // 31 93 FileQuotaInformation, // 32 94 FileReparsePointInformation, // 33 95 FileNetworkOpenInformation, // 34 96 FileAttributeTagInformation, // 35 97 FileTrackingInformation, // 36 98 FileIdBothDirectoryInformation, // 37 99 FileIdFullDirectoryInformation, // 38 100 FileValidDataLengthInformation, // 39 101 FileShortNameInformation, // 40 102 FileIoCompletionNotificationInformation, // 41 103 FileIoStatusBlockRangeInformation, // 42 104 FileIoPriorityHintInformation, // 43 105 FileSfioReserveInformation, // 44 106 FileSfioVolumeInformation, // 45 107 FileHardLinkInformation, // 46 108 FileProcessIdsUsingFileInformation, // 47 109 FileNormalizedNameInformation, // 48 110 FileNetworkPhysicalNameInformation, // 49 111 FileIdGlobalTxDirectoryInformation, // 50 112 FileMaximumInformation 113 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS; 114 115 116 /* kernel structures for QueryDirectory results */ 117 typedef struct _FILE_NAMES_INFORMATION { 118 ULONG NextEntryOffset; 119 ULONG FileIndex; 120 ULONG FileNameLength; 121 WCHAR FileName[1]; 122 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION; 123 124 typedef struct _FILE_DIRECTORY_INFO { 125 ULONG NextEntryOffset; 126 ULONG FileIndex; 127 LARGE_INTEGER CreationTime; 128 LARGE_INTEGER LastAccessTime; 129 LARGE_INTEGER LastWriteTime; 130 LARGE_INTEGER ChangeTime; 131 LARGE_INTEGER EndOfFile; 132 LARGE_INTEGER AllocationSize; 133 ULONG FileAttributes; 134 ULONG FileNameLength; 135 WCHAR FileName[1]; 136 } FILE_DIRECTORY_INFO, *PFILE_DIRECTORY_INFO; 137 138 typedef struct _FILE_BOTH_DIR_INFORMATION { 139 ULONG NextEntryOffset; 140 ULONG FileIndex; 141 LARGE_INTEGER CreationTime; 142 LARGE_INTEGER LastAccessTime; 143 LARGE_INTEGER LastWriteTime; 144 LARGE_INTEGER ChangeTime; 145 LARGE_INTEGER EndOfFile; 146 LARGE_INTEGER AllocationSize; 147 ULONG FileAttributes; 148 ULONG FileNameLength; 149 ULONG EaSize; 150 CCHAR ShortNameLength; 151 WCHAR ShortName[12]; 152 WCHAR FileName[1]; 153 } FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION; 154 155 typedef struct _FILE_FULL_DIR_INFO { 156 ULONG NextEntryOffset; 157 ULONG FileIndex; 158 LARGE_INTEGER CreationTime; 159 LARGE_INTEGER LastAccessTime; 160 LARGE_INTEGER LastWriteTime; 161 LARGE_INTEGER ChangeTime; 162 LARGE_INTEGER EndOfFile; 163 LARGE_INTEGER AllocationSize; 164 ULONG FileAttributes; 165 ULONG FileNameLength; 166 ULONG EaSize; 167 WCHAR FileName[1]; 168 } FILE_FULL_DIR_INFO, *PFILE_FULL_DIR_INFO; 169 170 typedef struct _FILE_ID_FULL_DIR_INFO { 171 ULONG NextEntryOffset; 172 ULONG FileIndex; 173 LARGE_INTEGER CreationTime; 174 LARGE_INTEGER LastAccessTime; 175 LARGE_INTEGER LastWriteTime; 176 LARGE_INTEGER ChangeTime; 177 LARGE_INTEGER EndOfFile; 178 LARGE_INTEGER AllocationSize; 179 ULONG FileAttributes; 180 ULONG FileNameLength; 181 ULONG EaSize; 182 LARGE_INTEGER FileId; 183 WCHAR FileName[1]; 184 } FILE_ID_FULL_DIR_INFO, *PFILE_ID_FULL_DIR_INFO; 185 186 typedef struct _FILE_LINK_INFORMATION { 187 BOOLEAN ReplaceIfExists; 188 HANDLE RootDirectory; 189 ULONG FileNameLength; 190 WCHAR FileName[1]; 191 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION; 192 193 typedef struct _FILE_FULL_EA_INFORMATION { 194 ULONG NextEntryOffset; 195 UCHAR Flags; 196 UCHAR EaNameLength; 197 USHORT EaValueLength; 198 CHAR EaName[1]; 199 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION; 200 201 typedef struct _FILE_GET_EA_INFORMATION { 202 ULONG NextEntryOffset; 203 UCHAR EaNameLength; 204 CHAR EaName[1]; 205 } FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION; 206 207 typedef struct _FILE_NETWORK_OPEN_INFORMATION { 208 LARGE_INTEGER CreationTime; 209 LARGE_INTEGER LastAccessTime; 210 LARGE_INTEGER LastWriteTime; 211 LARGE_INTEGER ChangeTime; 212 LARGE_INTEGER AllocationSize; 213 LARGE_INTEGER EndOfFile; 214 ULONG FileAttributes; 215 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION; 216 217 /* wdm.h */ 218 typedef enum _FSINFOCLASS { 219 FileFsVolumeInformation = 1, 220 FileFsLabelInformation, // 2 221 FileFsSizeInformation, // 3 222 FileFsDeviceInformation, // 4 223 FileFsAttributeInformation, // 5 224 FileFsControlInformation, // 6 225 FileFsFullSizeInformation, // 7 226 FileFsObjectIdInformation, // 8 227 FileFsDriverPathInformation, // 9 228 FileFsVolumeFlagsInformation,// 10 229 FileFsMaximumInformation 230 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS; 231 232 /* ntifs.h */ 233 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001 234 #define FILE_CASE_PRESERVED_NAMES 0x00000002 235 #define FILE_UNICODE_ON_DISK 0x00000004 236 #define FILE_PERSISTENT_ACLS 0x00000008 237 #define FILE_FILE_COMPRESSION 0x00000010 238 #define FILE_VOLUME_QUOTAS 0x00000020 239 #define FILE_SUPPORTS_SPARSE_FILES 0x00000040 240 #define FILE_SUPPORTS_REPARSE_POINTS 0x00000080 241 #define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100 242 #define FILE_VOLUME_IS_COMPRESSED 0x00008000 243 #define FILE_SUPPORTS_OBJECT_IDS 0x00010000 244 #define FILE_SUPPORTS_ENCRYPTION 0x00020000 245 #define FILE_NAMED_STREAMS 0x00040000 246 #define FILE_READ_ONLY_VOLUME 0x00080000 247 #define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000 248 #define FILE_SUPPORTS_TRANSACTIONS 0x00200000 249 #define FILE_SUPPORTS_HARD_LINKS 0x00400000 250 #define FILE_SUPPORTS_EXTENDED_ATTRIBUTES 0x00800000 251 #define FILE_SUPPORTS_OPEN_BY_FILE_ID 0x01000000 252 #define FILE_SUPPORTS_USN_JOURNAL 0x02000000 253 254 typedef struct _FILE_FS_ATTRIBUTE_INFORMATION { 255 ULONG FileSystemAttributes; 256 LONG MaximumComponentNameLength; 257 ULONG FileSystemNameLength; 258 WCHAR FileSystemName[1]; 259 } FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION; 260 261 /* ntddk.h */ 262 typedef struct _FILE_FS_SIZE_INFORMATION { 263 LARGE_INTEGER TotalAllocationUnits; 264 LARGE_INTEGER AvailableAllocationUnits; 265 ULONG SectorsPerAllocationUnit; 266 ULONG BytesPerSector; 267 } FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION; 268 269 typedef struct _FILE_FS_FULL_SIZE_INFORMATION { 270 LARGE_INTEGER TotalAllocationUnits; 271 LARGE_INTEGER CallerAvailableAllocationUnits; 272 LARGE_INTEGER ActualAvailableAllocationUnits; 273 ULONG SectorsPerAllocationUnit; 274 ULONG BytesPerSector; 275 } FILE_FS_FULL_SIZE_INFORMATION, *PFILE_FS_FULL_SIZE_INFORMATION; 276 277 typedef struct _FILE_INTERNAL_INFORMATION { 278 LARGE_INTEGER IndexNumber; 279 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION; 280 #endif 281