From 4bb1b64da0a26304d974f32ae42018fb4e100bf3 Mon Sep 17 00:00:00 2001 From: stan-sz <37585349+stan-sz@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:57:46 +0200 Subject: [PATCH] Update VolumeInfoCache.cs --- lib/Windows/VolumeInfoCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Windows/VolumeInfoCache.cs b/lib/Windows/VolumeInfoCache.cs index 06aff76..c4125c8 100644 --- a/lib/Windows/VolumeInfoCache.cs +++ b/lib/Windows/VolumeInfoCache.cs @@ -151,12 +151,12 @@ public VolumeInfo GetVolumeForPath(string path) out ulong _); if (!result) { + int lastErr = Marshal.GetLastWin32Error(); if (lastErr == NativeMethods.ERROR_DEV_NOT_EXIST) { return null; } - int lastErr = Marshal.GetLastWin32Error(); NativeMethods.ThrowSpecificIoException(lastErr, $"Failed retrieving drive volume cluster layout information for {volumePaths.PrimaryDriveRootPath} with winerror {lastErr}"); }