Changeset 107378 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Dec 19, 2024 12:51:59 PM (4 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/nt/RTFileDelete-r3-nt.cpp
r107377 r107378 76 76 IO_STATUS_BLOCK Ios = RTNT_IO_STATUS_BLOCK_INITIALIZER; 77 77 OBJECT_ATTRIBUTES ObjAttr; 78 InitializeObjectAttributes(&ObjAttr, &NtName, 0/*fAttrib*/, hRootDir, NULL);78 InitializeObjectAttributes(&ObjAttr, &NtName, OBJ_CASE_INSENSITIVE /*fAttrib*/, hRootDir, NULL); 79 79 80 80 ULONG fOpenOptions = FILE_NON_DIRECTORY_FILE | FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_REPARSE_POINT … … 149 149 * grok the reparse point stuff. 150 150 */ 151 else if ( 151 else if (rcNt == STATUS_INVALID_PARAMETER) 152 152 { 153 153 fOpenOptions &= ~FILE_OPEN_REPARSE_POINT; … … 166 166 0 /*EaLength*/); 167 167 } 168 /*169 * When getting STATUS_OBJECT_PATH_NOT_FOUND we re-initialize the object attributes170 * with OBJ_CASE_INSENSITIVE and try again. This is necessary for older object managers (i.e. on NT4)171 * when trying to delete files with a path *and* leading spaces in the file name,172 * i.e. "c:\temp\ file_with_a_leading_space".173 *174 * See @bugref{10826}.175 */176 else if ( rcNt == STATUS_OBJECT_PATH_NOT_FOUND)177 {178 InitializeObjectAttributes(&ObjAttr, &NtName, OBJ_CASE_INSENSITIVE /*fAttrib*/, hRootDir, NULL);179 180 hPath = RTNT_INVALID_HANDLE_VALUE;181 RTNT_IO_STATUS_BLOCK_REINIT(&Ios);182 rcNt = NtCreateFile(&hPath,183 DELETE | FILE_READ_ATTRIBUTES | SYNCHRONIZE,184 &ObjAttr,185 &Ios,186 NULL /*AllocationSize*/,187 FILE_ATTRIBUTE_NORMAL,188 FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,189 FILE_OPEN,190 fOpenOptions,191 NULL /*EaBuffer*/,192 0 /*EaLength*/);193 }194 195 168 /* else: 196 169 DeleteFileW will retry opening the file w/o FILE_READ_ATTRIBUTES here when
Note:
See TracChangeset
for help on using the changeset viewer.