Skip to content

modify Windows GetAccessPaths to handle volumes that don't exist#190

Merged
leehinman merged 1 commit intoelastic:masterfrom
leehinman:windows_GetVolumePathsForVolume_file_not_found
Mar 18, 2026
Merged

modify Windows GetAccessPaths to handle volumes that don't exist#190
leehinman merged 1 commit intoelastic:masterfrom
leehinman:windows_GetVolumePathsForVolume_file_not_found

Conversation

@leehinman
Copy link
Copy Markdown

Fix Windows GetAccessPaths error on non-existent volumes

Summary

  • GetVolumePathsForVolume can return ERROR_FILE_NOT_FOUND for volume names returned by GetVolumes that no longer exist (e.g., ejected, transient or ghost volumes).
  • Previously, any error from GetVolumePathsForVolume caused GetAccessPaths to return an error, making the entire call fail.
  • This change treats ERROR_FILE_NOT_FOUND as a non-fatal condition: the volume is silently skipped, consistent with how volumes with no mount paths are handled.

Root Cause

The Windows GetVolumes API can enumerate volume GUIDs for volumes that are registered but not currently present on the system. Calling GetVolumePathsForVolume on such a volume returns ERROR_FILE_NOT_FOUND. This is an expected OS behavior, not a true error.

Test Plan

  • Verify GetAccessPaths succeeds on Windows when transient/ejected volumes are present
  • Verify normal volumes still return their mount paths correctly

@leehinman leehinman marked this pull request as ready for review March 18, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants