-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #78220: Can't access OneDrive folder
As of Windows 1903, when the OneDrive on-demand feature is enabled, the OneDrive folder is reported as reparse point by `FindFirstFile()`, but trying to get information about the reparse point using `DeviceIoControl()` fails with `ERROR_NOT_A_REPARSE_POINT`. We work around this problem by falling back to `GetFileInformationByHandle()` if that happens, but only if the reparse point is reported as cloud reparse point, and only if PHP is running on Windows 1903 or later. The patch has been developed in collaboration with ab@php.net. We should keep an eye on the somewhat quirky OneDrive behavior, since it might change again in a future Windows release.
- Loading branch information
Showing
3 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--TEST-- | ||
Bug #78220 (Can't access OneDrive folder) | ||
--SKIPIF-- | ||
<?php | ||
if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only"); | ||
?> | ||
--FILE-- | ||
<?php | ||
$onedrive_dirs = array_unique([getenv('OneDrive'), getenv('OneDriveCommercial')]); | ||
foreach ($onedrive_dirs as $dir) { | ||
if ($dir && scandir($dir) === FALSE) { | ||
echo "can't scan $dir\n"; | ||
} | ||
} | ||
?> | ||
--EXPECT-- |