diff --git a/Directory.Build.props b/Directory.Build.props index 1977917..912d609 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -26,7 +26,7 @@ - 0.4.0 + 0.4.1 0.9.9999.0 Microsoft diff --git a/README.md b/README.md index 3cc4b44..5c6bcd0 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,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.4.1 October 2024: Add ERROR_DEV_NOT_EXIST handling on volume enumeration * 0.4.0 October 2024: Remove async versions of `CloneFile` as the implementation did not use overlapped I/O anyway. CoW support is releasing in the Server 2025 and Win11 24H2 wave, built into the `CopyFile` API suite and on by default for Dev Drive and ReFS, so overlapped I/O in this library will never be implemented. Resolves https://github.com/microsoft/CopyOnWrite/issues/50 * 0.3.12 October 2024: Add ERROR_DEV_NOT_EXIST handling on getting free disk space * 0.3.11 September 2024: Add ERROR_DEV_NOT_EXIST handling on volume enumeration diff --git a/lib/Windows/VolumeInfoCache.cs b/lib/Windows/VolumeInfoCache.cs index c4125c8..852efaf 100644 --- a/lib/Windows/VolumeInfoCache.cs +++ b/lib/Windows/VolumeInfoCache.cs @@ -134,7 +134,8 @@ public VolumeInfo GetVolumeForPath(string path) lastErr == ERROR_INVALID_PARAMETER || lastErr == FVE_E_LOCKED_VOLUME || lastErr == NativeMethods.ERROR_ACCESS_DENIED || - lastErr == NativeMethods.ERROR_FILE_NOT_FOUND) + lastErr == NativeMethods.ERROR_FILE_NOT_FOUND || + lastErr == NativeMethods.ERROR_DEV_NOT_EXIST) { return null; } @@ -152,10 +153,6 @@ public VolumeInfo GetVolumeForPath(string path) if (!result) { int lastErr = Marshal.GetLastWin32Error(); - if (lastErr == NativeMethods.ERROR_DEV_NOT_EXIST) - { - return null; - } NativeMethods.ThrowSpecificIoException(lastErr, $"Failed retrieving drive volume cluster layout information for {volumePaths.PrimaryDriveRootPath} with winerror {lastErr}");