- Timestamp:
- Apr 24, 2019 4:19:10 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/SharedFolders/driver
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.c
r76553 r78279 261 261 #endif 262 262 { 263 /** @todo r=bird: How is this file size accurate given that the file resides 264 * on the host and be grown/shrunk independently there? Why is this 265 * only done when FCB_STATE_READCACHEING_ENABLED is clear? */ 263 266 if (ByteOffset >= FileSize) 264 267 { -
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/path.c
r76553 r78279 63 63 { 64 64 Log(("VBOXSF: vbsfProcessCreate: Unsupported: extended attributes!\n")); 65 Status = STATUS_NOT_SUPPORTED; 65 Status = STATUS_NOT_SUPPORTED; /// @todo STATUS_EAS_NOT_SUPPORTED ? 66 66 goto failure; 67 67 } … … 105 105 CreateDisposition = RxContext->Create.NtCreateParameters.Disposition; 106 106 107 bf.CreateDirectory = ( BOOLEAN)(bf.DirectoryFile && ((CreateDisposition == FILE_CREATE) || (CreateDisposition == FILE_OPEN_IF)));108 bf.OpenDirectory = ( BOOLEAN)(bf.DirectoryFile && ((CreateDisposition == FILE_OPEN) || (CreateDisposition == FILE_OPEN_IF)));107 bf.CreateDirectory = (bf.DirectoryFile && ((CreateDisposition == FILE_CREATE) || (CreateDisposition == FILE_OPEN_IF))); 108 bf.OpenDirectory = (bf.DirectoryFile && ((CreateDisposition == FILE_OPEN) || (CreateDisposition == FILE_OPEN_IF))); 109 109 bf.TemporaryFile = BooleanFlagOn(RxContext->Create.NtCreateParameters.FileAttributes, FILE_ATTRIBUTE_TEMPORARY); 110 110 -
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsfhlp.c
r76553 r78279 39 39 40 40 /** 41 * Convert VBox IRT file attributes to NT file attributes41 * Converts VBox (IPRT) file mode to NT file attributes. 42 42 * 43 43 * @returns NT file attributes 44 * @param fMode IRT file attributes 45 * 46 */ 47 uint32_t VBoxToNTFileAttributes(uint32_t fMode) 48 { 49 uint32_t FileAttributes = 0; 50 51 if (fMode & RTFS_DOS_READONLY) 52 FileAttributes |= FILE_ATTRIBUTE_READONLY; 53 if (fMode & RTFS_DOS_HIDDEN) 54 FileAttributes |= FILE_ATTRIBUTE_HIDDEN; 55 if (fMode & RTFS_DOS_SYSTEM) 56 FileAttributes |= FILE_ATTRIBUTE_SYSTEM; 57 if (fMode & RTFS_DOS_DIRECTORY) 58 FileAttributes |= FILE_ATTRIBUTE_DIRECTORY; 59 if (fMode & RTFS_DOS_ARCHIVED) 60 FileAttributes |= FILE_ATTRIBUTE_ARCHIVE; 61 if (fMode & RTFS_DOS_NT_TEMPORARY) 62 FileAttributes |= FILE_ATTRIBUTE_TEMPORARY; 63 if (fMode & RTFS_DOS_NT_SPARSE_FILE) 64 FileAttributes |= FILE_ATTRIBUTE_SPARSE_FILE; 65 if (fMode & RTFS_DOS_NT_REPARSE_POINT) 66 FileAttributes |= FILE_ATTRIBUTE_REPARSE_POINT; 67 if (fMode & RTFS_DOS_NT_COMPRESSED) 68 FileAttributes |= FILE_ATTRIBUTE_COMPRESSED; 69 /* if (fMode & RTFS_DOS_NT_OFFLINE) */ 70 if (fMode & RTFS_DOS_NT_NOT_CONTENT_INDEXED) 71 FileAttributes |= FILE_ATTRIBUTE_NOT_CONTENT_INDEXED; 72 if (fMode & RTFS_DOS_NT_ENCRYPTED) 73 FileAttributes |= FILE_ATTRIBUTE_ENCRYPTED; 74 if (fMode & RTFS_DOS_NT_NORMAL) 75 FileAttributes |= FILE_ATTRIBUTE_NORMAL; 76 return FileAttributes; 44 * @param fIprtMode IPRT file mode. 45 * 46 */ 47 uint32_t VBoxToNTFileAttributes(uint32_t fIprtMode) 48 { 49 AssertCompile((RTFS_DOS_READONLY >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_READONLY); 50 AssertCompile((RTFS_DOS_HIDDEN >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_HIDDEN); 51 AssertCompile((RTFS_DOS_SYSTEM >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_SYSTEM); 52 AssertCompile((RTFS_DOS_DIRECTORY >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_DIRECTORY); 53 AssertCompile((RTFS_DOS_ARCHIVED >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_ARCHIVE); 54 /* skipping: RTFS_DOS_NT_DEVICE */ 55 AssertCompile((RTFS_DOS_NT_NORMAL >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_NORMAL); 56 AssertCompile((RTFS_DOS_NT_TEMPORARY >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_TEMPORARY); 57 AssertCompile((RTFS_DOS_NT_SPARSE_FILE >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_SPARSE_FILE); 58 AssertCompile((RTFS_DOS_NT_REPARSE_POINT >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_REPARSE_POINT); 59 AssertCompile((RTFS_DOS_NT_COMPRESSED >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_COMPRESSED); 60 /* skipping: RTFS_DOS_NT_OFFLINE */ 61 AssertCompile((RTFS_DOS_NT_NOT_CONTENT_INDEXED >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_NOT_CONTENT_INDEXED); 62 AssertCompile((RTFS_DOS_NT_ENCRYPTED >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_ENCRYPTED); 63 64 uint32_t fNtAttribs = (fIprtMode & (RTFS_DOS_MASK_NT & ~(RTFS_DOS_NT_OFFLINE | RTFS_DOS_NT_DEVICE)) >> RTFS_DOS_SHIFT); 65 return fNtAttribs ? fNtAttribs : FILE_ATTRIBUTE_NORMAL; 77 66 } 78 67 79 68 /** 80 * Convert VBox IRT file attributes to NT file attributes 81 * 82 * @returns NT file attributes 83 * @param fMode IRT file attributes 84 * 85 */ 86 uint32_t NTToVBoxFileAttributes(uint32_t fMode) 87 { 88 uint32_t FileAttributes = 0; 89 90 if (fMode & FILE_ATTRIBUTE_READONLY) 91 FileAttributes |= RTFS_DOS_READONLY; 92 if (fMode & FILE_ATTRIBUTE_HIDDEN) 93 FileAttributes |= RTFS_DOS_HIDDEN; 94 if (fMode & FILE_ATTRIBUTE_SYSTEM) 95 FileAttributes |= RTFS_DOS_SYSTEM; 96 if (fMode & FILE_ATTRIBUTE_DIRECTORY) 97 FileAttributes |= RTFS_DOS_DIRECTORY; 98 if (fMode & FILE_ATTRIBUTE_ARCHIVE) 99 FileAttributes |= RTFS_DOS_ARCHIVED; 100 if (fMode & FILE_ATTRIBUTE_TEMPORARY) 101 FileAttributes |= RTFS_DOS_NT_TEMPORARY; 102 if (fMode & FILE_ATTRIBUTE_SPARSE_FILE) 103 FileAttributes |= RTFS_DOS_NT_SPARSE_FILE; 104 if (fMode & FILE_ATTRIBUTE_REPARSE_POINT) 105 FileAttributes |= RTFS_DOS_NT_REPARSE_POINT; 106 if (fMode & FILE_ATTRIBUTE_COMPRESSED) 107 FileAttributes |= RTFS_DOS_NT_COMPRESSED; 108 if (fMode & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) 109 FileAttributes |= RTFS_DOS_NT_NOT_CONTENT_INDEXED; 110 if (fMode & FILE_ATTRIBUTE_ENCRYPTED) 111 FileAttributes |= RTFS_DOS_NT_ENCRYPTED; 112 if (fMode & FILE_ATTRIBUTE_NORMAL) 113 { 114 FileAttributes |= RTFS_DOS_NT_NORMAL; 115 } 116 return FileAttributes; 69 * Converts NT file attributes to VBox (IPRT) ones. 70 * 71 * @returns IPRT file mode 72 * @param fNtAttribs NT file attributes 73 */ 74 uint32_t NTToVBoxFileAttributes(uint32_t fNtAttribs) 75 { 76 uint32_t fIprtMode = (fNtAttribs << RTFS_DOS_SHIFT) & RTFS_DOS_MASK_NT; 77 return fIprtMode ? fIprtMode : RTFS_DOS_NT_NORMAL; 117 78 } 118 79 … … 139 100 } 140 101 141 142 143 144 145 146 147 102 /** 103 * Convert VBox error code to NT status code 104 * 105 * @returns NT status code 106 * @param vboxRC VBox error code 107 * 108 */ 148 109 NTSTATUS VBoxErrorToNTStatus(int vboxRC) 149 110 { -
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsfhlp.h
r76563 r78279 32 32 NTSTATUS vbsfHlpCreateDriveLetter(WCHAR Letter, UNICODE_STRING *pDeviceName); 33 33 NTSTATUS vbsfHlpDeleteDriveLetter(WCHAR Letter); 34 35 /** 36 * Convert VBox IRT file attributes to NT file attributes 37 * 38 * @returns NT file attributes 39 * @param fMode IRT file attributes 40 * 41 */ 42 uint32_t VBoxToNTFileAttributes(uint32_t fMode); 43 44 /** 45 * Convert VBox IRT file attributes to NT file attributes 46 * 47 * @returns NT file attributes 48 * @param fMode IRT file attributes 49 * 50 */ 51 uint32_t NTToVBoxFileAttributes(uint32_t fMode); 34 uint32_t VBoxToNTFileAttributes(uint32_t fIprtMode); 35 uint32_t NTToVBoxFileAttributes(uint32_t fNtAttribs); 52 36 53 37 /**
Note:
See TracChangeset
for help on using the changeset viewer.