Changeset 70428 in vbox for trunk/src/VBox/Runtime/r3/nt
- Timestamp:
- Jan 2, 2018 3:01:20 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 120033
- Location:
- trunk/src/VBox/Runtime/r3/nt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/nt/internal-r3-nt.h
r69795 r70428 37 37 38 38 39 #if def DEBUG_bird39 #if 1 40 40 /** Enables the "\\!\" NT path pass thru as well as hacks for listing NT object 41 41 * directories. */ 42 42 # define IPRT_WITH_NT_PATH_PASSTHRU 1 43 43 #endif 44 44 45 45 46 -
trunk/src/VBox/Runtime/r3/nt/pathint-nt.cpp
r70200 r70428 226 226 && pszPath[2]) 227 227 { 228 #ifdef IPRT_WITH_NT_PATH_PASSTHRU 229 /* 230 * Special trick: The path starts with RTPATH_NT_PASSTHRU_PREFIX, we will skip past the bang and pass it thru. 231 */ 232 if ( pszPath[2] == ':' 233 && pszPath[3] == 'i' 234 && pszPath[4] == 'p' 235 && pszPath[5] == 'r' 236 && pszPath[6] == 't' 237 && pszPath[7] == 'n' 238 && pszPath[8] == 't' 239 && pszPath[9] == ':' 240 && RTPATH_IS_SLASH(pszPath[10])) 241 return rtNtPathUtf8ToUniStr(pNtName, phRootDir, pszPath + 10); 242 #endif 243 228 244 if ( pszPath[2] == '?' 229 245 && RTPATH_IS_SLASH(pszPath[3])) 230 246 return rtNtPathFromWinUtf8PassThru(pNtName, phRootDir, pszPath); 231 232 #ifdef IPRT_WITH_NT_PATH_PASSTHRU233 /* Special hack: The path starts with "\\\\!\\", we will skip past the bang and pass it thru. */234 if ( pszPath[2] == '!'235 && RTPATH_IS_SLASH(pszPath[3]))236 return rtNtPathUtf8ToUniStr(pNtName, phRootDir, pszPath + 3);237 #endif238 247 239 248 if ( pszPath[2] == '.' … … 331 340 && !RTPATH_IS_SLASH(pwszWinPath[2]) ) 332 341 { 333 if ( pwszWinPath[2] == '?'334 && cwcWinPath >= 4335 && RTPATH_IS_SLASH(pwszWinPath[3]))336 return rtNtPathFromWinUtf16PassThru(pNtName, phRootDir, pwszWinPath, cwcWinPath);337 338 342 #ifdef IPRT_WITH_NT_PATH_PASSTHRU 339 /* Special hack: The path starts with "\\\\!\\", we will skip past the bang and pass it thru. */ 340 if ( pwszWinPath[2] == '!' 341 && cwcWinPath >= 4 342 && RTPATH_IS_SLASH(pwszWinPath[3])) 343 { 344 pwszWinPath += 3; 345 cwcWinPath -= 3; 343 /* 344 * Special trick: The path starts with RTPATH_NT_PASSTHRU_PREFIX, we will skip past the bang and pass it thru. 345 */ 346 if ( cwcWinPath >= sizeof(RTPATH_NT_PASSTHRU_PREFIX) - 1U 347 && pwszWinPath[2] == ':' 348 && pwszWinPath[3] == 'i' 349 && pwszWinPath[4] == 'p' 350 && pwszWinPath[5] == 'r' 351 && pwszWinPath[6] == 't' 352 && pwszWinPath[7] == 'n' 353 && pwszWinPath[8] == 't' 354 && pwszWinPath[9] == ':' 355 && RTPATH_IS_SLASH(pwszWinPath[10]) ) 356 { 357 pwszWinPath += 10; 358 cwcWinPath -= 10; 346 359 if (cwcWinPath < _32K - 1) 347 360 { … … 364 377 } 365 378 #endif 379 380 if ( pwszWinPath[2] == '?' 381 && cwcWinPath >= 4 382 && RTPATH_IS_SLASH(pwszWinPath[3])) 383 return rtNtPathFromWinUtf16PassThru(pNtName, phRootDir, pwszWinPath, cwcWinPath); 366 384 367 385 if ( pwszWinPath[2] == '.' … … 866 884 if ( !RTPATH_IS_SLASH(pszPath[0]) 867 885 || !RTPATH_IS_SLASH(pszPath[1]) 868 || pszPath[2] != '!' 869 || RTPATH_IS_SLASH(pszPath[3])) 886 || pszPath[2] != ':' 887 || pszPath[3] != 'i' 888 || pszPath[4] != 'p' 889 || pszPath[5] != 'r' 890 || pszPath[6] != 't' 891 || pszPath[7] != 'n' 892 || pszPath[8] != 't' 893 || pszPath[9] != ':' 894 || !RTPATH_IS_SLASH(pszPath[10]) ) 870 895 #endif 871 896 pfObjDir = NULL; … … 988 1013 /* Rought conversion of the access flags. */ 989 1014 ULONG fObjDesiredAccess = 0; 990 if (fDesiredAccess & (GENERIC_ALL | STANDARD_RIGHTS_ALL)) 1015 if ( (fDesiredAccess & GENERIC_ALL) 1016 || (fDesiredAccess & STANDARD_RIGHTS_ALL) == STANDARD_RIGHTS_ALL) 991 1017 fObjDesiredAccess = DIRECTORY_ALL_ACCESS; 992 1018 else 993 1019 { 994 if (fDesiredAccess & ( FILE_GENERIC_WRITE | GENERIC_WRITE | STANDARD_RIGHTS_WRITE))995 fObjDesiredAccess |= DIRECTORY_CREATE_OBJECT | DIRECTORY_CREATE_OBJECT ;1020 if (fDesiredAccess & (GENERIC_WRITE | STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA)) 1021 fObjDesiredAccess |= DIRECTORY_CREATE_OBJECT | DIRECTORY_CREATE_OBJECT | DIRECTORY_CREATE_SUBDIRECTORY; 996 1022 if ( (fDesiredAccess & (FILE_LIST_DIRECTORY | FILE_GENERIC_READ | GENERIC_READ | STANDARD_RIGHTS_READ)) 997 1023 || !fObjDesiredAccess)
Note:
See TracChangeset
for help on using the changeset viewer.