Unique Machine ID for a Windows CE Device

こ雲淡風輕ζ 提交于 2019-12-21 06:41:19

问题


I need to generate unique machine ID for a CE 6.0 device. On Windows OS, I was using the WMI to obtain some hardware identifiers from which I constructed this ID. Apparently, WMI is not supported on Win CE so I am looking for alternatives.

At the moment I am playing with OS image that I have constructed in Platform Builder and testing my app in emulator, only later I will be delivered the real WinCE device.

I have tried both GetDeviceUniqueID and KernelIoControl(IOCTL_HAL_GET_DEVICEID,... but they both return ERROR_NOT_SUPPORTED ( 0x80070032 ).

  1. Do I need to include some package from the wince catalog in order to enable this feature?
  2. Is this limitation only on emulators? (i mean, could it be that OEM's are implementing this unique-id-feature for real devices?

  3. Do you have any other idea how I could construct this value? Like getting hardware / OS serials etc. and how?


回答1:


If you're building the OS, then you need to implement the IOCTL so that KernelIoControl returns something. How its derived is completely up to you. I've seen the MAC as a base, as well as the serial number of on-board flash.

How you'd do that for your particular platform I can't say, but as an example for x86 you might clone the code at %WINCEROOT&\PLATFORM\COMMON\SRC\X86\COMMON\IOCTL\devinfo.c and modify the clone (don't modify the common code, obviously).




回答2:


Not sure if it's old hat, but this thread seems relevant. It seems to mention folks using emulators both getting "real-looking" ID:s, and folks getting constant 0.



来源:https://stackoverflow.com/questions/1119574/unique-machine-id-for-a-windows-ce-device

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