Skip to content

Commit

Permalink
Follow up on ERROR_DEV_NOT_EXIST (#53)
Browse files Browse the repository at this point in the history
The fix in 0.3.12 handled the error in incorrect place.
  • Loading branch information
stan-sz authored Oct 28, 2024
1 parent 59ea2bc commit ee6df59
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
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.4.0</Version>
<Version>0.4.1</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 @@ -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
Expand Down
7 changes: 2 additions & 5 deletions lib/Windows/VolumeInfoCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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}");
Expand Down

0 comments on commit ee6df59

Please sign in to comment.