I was wondering how one would find the available memory slots vs taken slots on a motherboard in C#. With WMI I can find a total number of slots and also a list of memory sticks, but the information provided in both cases, specifically the latter, it’s seemingly generic and changes depending on the motherboard.
Essentially I’m looking to create a list every slot on the board and which specific ones are taken and by what kind. I imagine this may be able to be done with WMI, but as said, I can’t seem to get around the problem that “DeviceLocator” in Win32_PhysicalMemory is confusing and uncertain.
It takes a combination of using the information provided by Win32_PhysicalMemory with information such as the “Manufacturer” and “Product” fields in Win32_BaseBoard to create a set of known slots and compare the “DeviceLocator” field in Win32_PhysicalMemory against it. Not ideal, but it’s the only solution that seems apparent.