Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover ERROR_NO_SUCH_DEVICE #47

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/Windows/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public enum FileSystemFeature : uint
public const int ERROR_INVALID_HANDLE = 6;
public const int ERROR_NO_MORE_FILES = 18;
public const int ERROR_MORE_DATA = 234;
public const int ERROR_NO_SUCH_DEVICE = 433;

// ReFS specific WinError codes.
public const int ERROR_BLOCK_TOO_MANY_REFERENCES = 347;
Expand Down
3 changes: 2 additions & 1 deletion lib/Windows/VolumeEnumerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ private static IReadOnlyList<string> GetVolumePathNamesForVolumeName(
if (!success)
{
int lastErr = Marshal.GetLastWin32Error();
if (lastErr == NativeMethods.ERROR_FILE_NOT_FOUND)
if (lastErr == NativeMethods.ERROR_FILE_NOT_FOUND ||
lastErr == NativeMethods.ERROR_NO_SUCH_DEVICE)
{
// No mount points for this volume.
return Array.Empty<string>();
Expand Down
Loading