Skip to content

Commit 945d316

Browse files
authored
Add ERROR_DEV_NOT_EXIST handling on volume enumeration (#49)
1 parent 77aae72 commit 945d316

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<PropertyGroup>
2727

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

3232
<Company>Microsoft</Company>

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ File clones on Windows do not actually allocate space on-drive for the clone. Th
4343

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

46+
* 0.3.11 September 2024: Add ERROR_DEV_NOT_EXIST handling on volume enumeration
4647
* 0.3.10 September 2024: Add ERROR_NO_SUCH_DEVICE handling on volume enumeration
4748
* 0.3.9 September 2024: Fix https://github.com/microsoft/CopyOnWrite/issues/44 - follow up on ignoring FILE_NOT_FOUND on volume enumeration
4849
* 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.

lib/Windows/NativeMethods.cs

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ public enum FileSystemFeature : uint
157157
public const int ERROR_ACCESS_DENIED = 5;
158158
public const int ERROR_INVALID_HANDLE = 6;
159159
public const int ERROR_NO_MORE_FILES = 18;
160+
public const int ERROR_DEV_NOT_EXIST = 55;
160161
public const int ERROR_MORE_DATA = 234;
161162
public const int ERROR_NO_SUCH_DEVICE = 433;
162163

lib/Windows/VolumeEnumerator.cs

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ private static IReadOnlyList<string> GetVolumePathNamesForVolumeName(
144144
{
145145
int lastErr = Marshal.GetLastWin32Error();
146146
if (lastErr == NativeMethods.ERROR_FILE_NOT_FOUND ||
147+
lastErr == NativeMethods.ERROR_DEV_NOT_EXIST ||
147148
lastErr == NativeMethods.ERROR_NO_SUCH_DEVICE)
148149
{
149150
// No mount points for this volume.

0 commit comments

Comments
 (0)