WMI Win32_PhysicalMedia SerialNumber is sometimes hexadecimal and sometimes in reversed byte order

↘锁芯ラ 提交于 2019-12-07 08:40:59

问题


I am using WMI with C++ to get the physical disk serial number.

On Windows 7 64bit, I get a string with the serial number.

While when running the same application on a Windows XP 64bit machine I get a hexadecimal string with each char's values reversed.

I have noticed 3 different behaviours so far:

  1. Windows 7 64bit String in correct order as expect
  2. Windows XP 64bit(Machine 1) Hexadecimal string, reversed byte order
  3. Windows XP 64bit(Machine 2) String in reversed byte order

I have used wbemtest.exe and have confirmed that these results are coming from WMI, not my own code.

When I use DeviceIOControl and get the SMART information I always get the serial number as a hexadecimal string with reversed byte order.

Is this expected behavior and how does one handle this?

来源:https://stackoverflow.com/questions/3903463/wmi-win32-physicalmedia-serialnumber-is-sometimes-hexadecimal-and-sometimes-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!