none
Win32_PhysicalMedia serial number returns garbage RRS feed

  • Question

  • sSometimes when running get-wmiobject win32_physicalmedia in administrative powershell on a system with 2+ scsi disks, the serial numbers returned is just garbage bytes.

    Some bad serial numbers I've seen:

    žÜ¥ÿÿ

    Ãÿÿ6P:ŽÃÿÿ6D:ŽÃÿÿ

    etc.

    Some strange things:

    Non administrative cmd or powershell returns the correct value always.

    wmic diskdrive get SerialNumber returns the correct value always (admin or non admin)

    My discoveries:

    When a correct serial number is present: an ioctl is called that copies the serial number back to the user. When the garbage bytes are present this stack isn't hit.

    #  Child-SP          RetAddr           Call Site
    00 ffffcb00`2f021950 fffff803`20f46212 storport!RaGetUnitStorageDeviceProperty+0x1fb
    01 ffffcb00`2f021b50 fffff803`20f461a5 storport!RaUnitStorageQueryDevicePropertyIoctl+0x36
    02 ffffcb00`2f021b80 fffff803`20ef1d3b storport!RaUnitStorageQueryPropertyIoctl+0xd1
    03 ffffcb00`2f021be0 fffff803`20ef1bda storport!RaUnitDeviceControlIrp+0x11b
    04 ffffcb00`2f021c60 fffff803`20cd317a storport!RaDriverDeviceControlIrp+0x5a
    05 ffffcb00`2f021ca0 fffff803`20cb182f CLASSPNP!ClassDeviceControl+0x38a
    06 ffffcb00`2f021e10 fffff803`20cd68ca disk!DiskDeviceControl+0x8f
    07 ffffcb00`2f021ea0 fffff803`202661b6 CLASSPNP!ClassDeviceControlDispatch+0x4a
    08 ffffcb00`2f021ed0 fffff803`20251fa3 partmgr!PmIoctlQueryProperty+0x56
    09 ffffcb00`2f021f10 fffff803`202518a3 partmgr!PmFilterDeviceControl+0xe3
    0a ffffcb00`2f021f60 fffff801`110e29fa partmgr!PmGlobalDispatch+0x63
    0b ffffcb00`2f021ff0 fffff801`110e27d4 nt!RawReadWriteDeviceControl+0x9e
    0c ffffcb00`2f022020 fffff803`1fa05206 nt!RawDispatch+0x78
    0d ffffcb00`2f022070 fffff803`1fa03146 FLTMGR!FltpLegacyProcessingAfterPreCallbacksCompleted+0x1a6
    0e ffffcb00`2f022100 fffff801`11153160 FLTMGR!FltpDispatch+0xb6
    0f ffffcb00`2f022160 fffff801`111524fc nt!IopSynchronousServiceTail+0x1a0
    10 ffffcb00`2f022220 fffff801`11151756 nt!IopXxxControlFile+0xd9c
    11 ffffcb00`2f022360 fffff801`10df5403 nt!NtDeviceIoControlFile+0x56
    12 ffffcb00`2f0223d0 00007fff`403f5be4 nt!KiSystemServiceCopyEnd+0x13


    OS Name:                   Microsoft Windows Server 2016 Datacenter
    OS Version:                10.0.14393 N/A Build 14393

    Sunday, June 2, 2019 1:01 AM