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 ).
Is this limitation only on emulators? (i mean, could it be that OEM's are implementing this unique-id-feature for real devices?
Do you have any other idea how I could construct this value? Like getting hardware / OS serials etc. and how?
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).
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.
User contributions licensed under CC BY-SA 3.0