Conversation
added 6 commits
March 2, 2026 12:57
the code was previously checking for associations between drive letters and collected STORAGE_DEVICE_NUMBER struct, and then relying on the generated handle \\.\PhysicalDrive[DeviceNumber] throwing an error for the drive now check STORAGE_DEVICE_NUMBER structs in three two ways. temporary devices seem to have DeviceNumber set to 0, but have PartitionNumber set above 32768, remove these devices. DeviceType is also in the returned struct. Check if it matches the FILE_DEVICE_DISK value. the code was iterating from 0 to 32 for deviceNumber and checking if it had a driveLetter. this was causing some drive letters to be skipped, since ultiple drive letters might belong to the same physical drive collect valid storageDeviceNumber structs into another map from drive letter to the struct. then iterate over this map from scratch
every invocation ioCountersWindows function.
…actual runtime at CheckSystemHandler.Init
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the code was previously checking for associations between drive letters
and collected STORAGE_DEVICE_NUMBER struct, and then relying on the
generated handle \.\PhysicalDrive[DeviceNumber] throwing an error for
the drive
now check STORAGE_DEVICE_NUMBER structs in three ways.
temporary devices seem to have DeviceNumber set to 0, but have
PartitionNumber set above 32768, remove these devices.
DeviceType is also in the returned struct. Check if it matches the
FILE_DEVICE_DISK value.
the code was iterating from 0 to 32 for deviceNumber and checking if it
had a driveLetter. this was causing some drive letters to be skipped,
since multiple drive letters might belong to the same physical drive
collect valid storageDeviceNumber structs into another map from drive
letter to the struct. then iterate over this map from scratch
this valid storageDeviceNumbers are initialized initialized and cached in init() function
logs print out filtered out / taken STORAGE_DEVICE_NUMBER structs. easier to debug
if a disk is not watched now.