Skip to content

Commit

Permalink
Add ERROR_DEV_NOT_EXIST handling on volume enumeration (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-sz authored Sep 24, 2024
1 parent 77aae72 commit 945d316
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PropertyGroup>

<!-- DOCSYNC: When changing version number update README.md -->
<Version>0.3.10.0</Version>
<Version>0.3.11.0</Version>
<AssemblyVersion>0.9.9999.0</AssemblyVersion>

<Company>Microsoft</Company>
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ File clones on Windows do not actually allocate space on-drive for the clone. Th

[![NuGet version (CopyOnWrite)](https://img.shields.io/nuget/v/CopyOnWrite?style=plastic)](https://www.nuget.org/packages/CopyOnWrite)

* 0.3.11 September 2024: Add ERROR_DEV_NOT_EXIST handling on volume enumeration
* 0.3.10 September 2024: Add ERROR_NO_SUCH_DEVICE handling on volume enumeration
* 0.3.9 September 2024: Fix https://github.com/microsoft/CopyOnWrite/issues/44 - follow up on ignoring FILE_NOT_FOUND on volume enumeration
* 0.3.8 March 2024: Fix https://github.com/microsoft/MSBuildSdks/issues/546 - ignore FILE_NOT_FOUND on volume enumeration. Plus add SourceLink to the main library.
Expand Down
1 change: 1 addition & 0 deletions lib/Windows/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public enum FileSystemFeature : uint
public const int ERROR_ACCESS_DENIED = 5;
public const int ERROR_INVALID_HANDLE = 6;
public const int ERROR_NO_MORE_FILES = 18;
public const int ERROR_DEV_NOT_EXIST = 55;
public const int ERROR_MORE_DATA = 234;
public const int ERROR_NO_SUCH_DEVICE = 433;

Expand Down
1 change: 1 addition & 0 deletions lib/Windows/VolumeEnumerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private static IReadOnlyList<string> GetVolumePathNamesForVolumeName(
{
int lastErr = Marshal.GetLastWin32Error();
if (lastErr == NativeMethods.ERROR_FILE_NOT_FOUND ||
lastErr == NativeMethods.ERROR_DEV_NOT_EXIST ||
lastErr == NativeMethods.ERROR_NO_SUCH_DEVICE)
{
// No mount points for this volume.
Expand Down

0 comments on commit 945d316

Please sign in to comment.