WMI: Win32_DiskDrive (get memory mapped address), to Win32_DeviceMemoryAddress?

0

How can I get the memory mapped device address for a disk drive starting with a disk enumerated by

PS C:\WINDOWS\system32> gwmi Win32_DiskDrive | fl *

I can use

PS C:\WINDOWS\system32> gwmi Win32_DeviceMemoryAddress | fl *

This command lists the memory mapped device addresses, however I do not see anything overlapping that to the Win32_DiskDrive.

Yes, I am new to gwmi. I know the basics, so maybe it is possible.

How do I get the memory mapped device address for a specific disk drive, say this one:

PSComputerName              : JMR-ENG-SARAH
ConfigManagerErrorCode      : 0
LastErrorCode               :
NeedsCleaning               :
Status                      : OK
DeviceID                    : \\.\PHYSICALDRIVE1
StatusInfo                  :
Partitions                  : 2
BytesPerSector              : 512
ConfigManagerUserConfig     : False
DefaultBlockSize            :
Index                       : 1
InstallDate                 :
InterfaceType               : SCSI
MaxBlockSize                :
MaxMediaSize                :
MinBlockSize                :
NumberOfMediaSupported      :
SectorsPerTrack             : 63
Size                        : 512105932800
TotalCylinders              : 62260
TotalHeads                  : 255
TotalSectors                : 1000206900
TotalTracks                 : 15876300
TracksPerCylinder           : 255
__GENUS                     : 2
__CLASS                     : Win32_DiskDrive
__SUPERCLASS                : CIM_DiskDrive
__DYNASTY                   : CIM_ManagedSystemElement
__RELPATH                   : Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE1"
__PROPERTY_COUNT            : 51
__DERIVATION                : {CIM_DiskDrive, CIM_MediaAccessDevice, CIM_LogicalDevice, CIM_LogicalElement...}
__SERVER                    : JMR-ENG-SARAH
__NAMESPACE                 : root\cimv2
__PATH                      : \\JMR-ENG-SARAH\root\cimv2:Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE1"
Availability                :
Capabilities                : {3, 4}
CapabilityDescriptions      : {Random Access, Supports Writing}
Caption                     : Samsung SSD 960 PRO 512GB
CompressionMethod           :
CreationClassName           : Win32_DiskDrive
Description                 : Disk drive
ErrorCleared                :
ErrorDescription            :
ErrorMethodology            :
FirmwareRevision            : 1B6QCXP7
Manufacturer                : (Standard disk drives)
MediaLoaded                 : True
MediaType                   : Fixed hard disk media
Model                       : Samsung SSD 960 PRO 512GB
Name                        : \\.\PHYSICALDRIVE1
PNPDeviceID                 : SCSI\DISK&VEN_NVME&PROD_SAMSUNG_SSD_960\7&11BF5A6C&0&000000
PowerManagementCapabilities :
PowerManagementSupported    :
SCSIBus                     : 0
SCSILogicalUnit             : 0
SCSIPort                    : 1
SCSITargetId                : 0
SerialNumber                : 0025_385C_6150_0AD4.
Signature                   :
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : JMR-ENG-SARAH
Scope                       : System.Management.ManagementScope
Path                        : \\JMR-ENG-SARAH\root\cimv2:Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE1"
Options                     : System.Management.ObjectGetOptions
ClassPath                   : \\JMR-ENG-SARAH\root\cimv2:Win32_DiskDrive
Properties                  : {Availability, BytesPerSector, Capabilities, CapabilityDescriptions...}
SystemProperties            : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY...}
Qualifiers                  : {dynamic, Locale, provider, UUID}
Site                        :
Container                   :

Here is a sample output from Win32_DeivceMemoryAddress:

PSComputerName      : JMR-ENG-SARAH
Status              : OK
Name                : 0xF7400000-0xF76FFFFF
MemoryType          : WindowDecode
__GENUS             : 2
__CLASS             : Win32_DeviceMemoryAddress
__SUPERCLASS        : Win32_SystemMemoryResource
__DYNASTY           : CIM_ManagedSystemElement
__RELPATH           : Win32_DeviceMemoryAddress.StartingAddress="4148166656"
__PROPERTY_COUNT    : 11
__DERIVATION        : {Win32_SystemMemoryResource, CIM_MemoryMappedIO, CIM_SystemResource, CIM_LogicalElement...}
__SERVER            : JMR-ENG-SARAH
__NAMESPACE         : root\cimv2
__PATH              : \\JMR-ENG-SARAH\root\cimv2:Win32_DeviceMemoryAddress.StartingAddress="4148166656"
Caption             : 0xF7400000-0xF76FFFFF
CreationClassName   : Win32_DeviceMemoryAddress
CSCreationClassName : Win32_ComputerSystem
CSName              : JMR-ENG-SARAH
Description         : 0xF7400000-0xF76FFFFF
EndingAddress       : 4151312383
InstallDate         :
StartingAddress     : 4148166656
Scope               : System.Management.ManagementScope
Path                : \\JMR-ENG-SARAH\root\cimv2:Win32_DeviceMemoryAddress.StartingAddress="4148166656"
Options             : System.Management.ObjectGetOptions
ClassPath           : \\JMR-ENG-SARAH\root\cimv2:Win32_DeviceMemoryAddress
Properties          : {Caption, CreationClassName, CSCreationClassName, CSName...}
SystemProperties    : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY...}
Qualifiers          : {dynamic, Locale, provider, UUID}
Site                :
Container           :

I found this site, which gives a nice list of available WMI Win32_* tags and through the the CIM ones.

What would be the WMI command and how do I get the information starting from a Win32_DiskDrive drive?

UPDATE: Windows does not, as of this question, handle NVMe SSDs the same as regular SSDs. As such, the IDE controller and many other features enumerated by WMI are either wrong or do not work.

Sarah Weinberger

Posted 2017-08-23T18:07:56.060

Reputation: 523

Answers

0

I am no WMI expert and not sure whether I am on a right tracks here.

But there is a Associators Of keyword in WQL language (SQL for WMI). Associators Of allows you to retrieve all instances that are associated with a particular source instance. So by the method of trail and error, I have narrowed it down to following commands:

Get-WmiObject -Query "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='\\.\PHYSICALDRIVE0'} WHERE ResultClass=Win32_PnPEntity"
Get-WmiObject -Query "ASSOCIATORS OF {Win32_PnPEntity.DeviceID='SCSI\DISK&VEN_&PROD_KINGSTON_SHSS37A\4&2B0C446D&0&040000'} WHERE ResultClass=Win32_IdeController"
Get-WmiObject -Query "ASSOCIATORS OF {Win32_IDEController.DeviceID='PCI\VEN_8086&DEV_8C03&SUBSYS_397817AA&REV_05\3&11583659&0&FA'} WHERE ResultClass=Win32_DeviceMemoryAddress"

DeviceID properties were hardcoded and found by piping output to fl * (to inspect the returned objects further)


You can also try to explore WMI repo further using the Associators Of keyword, Get-WMIObject -List command or GUI Explorer like WMI Explorer

WeatherForecastingRat

Posted 2017-08-23T18:07:56.060

Reputation: 173

That was a good college try. I updated my question to explicitly state that the drive in question, Samsung 960 Pro, is an NVMe SSD. WMI does not fully support NVMe SSDs, so the second query turns up empty. WMI does not do a lot of things or does them wrong. StorNVMe.sys needs an update, if that is what WMI uses. – Sarah Weinberger – 2017-08-29T22:57:24.447

maybe NMV drives are using different class/controller to store this info? What classes are there when you run second command without the WHERE clause? – WeatherForecastingRat – 2017-08-29T23:11:46.330