Hello,
i'm trying to get the unique DEVICEID from some PocketPC with the function:
KernelIoControl(IOCTL_HAL_GET_DEVICEID, IntPtr.Zero, 0, OutputBuffer, OutputBufferSize, ref BytesReturned);
...this works fine.
...But for some OEM device this function returns always the same code...
How can i get a unique identifier for that device
thanks for suggestions
Andrea C.

Device Unique ID
duck thing
Andrea,
We've used the following function successfully on all Symbol Mobile devices and it works:
Public Function GetDeviceID() As String Dim len As Int32 = 256, cb As Int32 = 0 Dim buffer(256) As Byte Dim ret As Int32buffer(0) = 0
buffer(1) = 1
Tryret = KernelIoControl(&H1010054, IntPtr.Zero, 0, buffer, len, cb)
Catch ex As ExceptionShowError(ex,
"GetDeviceID") End Try Dim dwPresetIDOffsset As Int32 = BitConverter.ToInt32(buffer, 4) Dim dwPlatformIDOffset As Int32 = BitConverter.ToInt32(buffer, &HC) Dim dwPlatformIDSize As Int32 = BitConverter.ToInt32(buffer, &H10) Dim sb As System.Text.StringBuilder = New System.Text.StringBuildersb.Append(
String.Format("{0:X8}-{1:X4}-{2:X4}-{3:X4}-", _BitConverter.ToInt32(buffer, dwPresetIDOffsset), _
BitConverter.ToInt16(buffer, dwPresetIDOffsset + 4), _
BitConverter.ToInt16(buffer, dwPresetIDOffsset + 6), _
BitConverter.ToInt16(buffer, dwPresetIDOffsset + 8)))
For i As Int32 = dwPlatformIDOffset To dwPlatformIDOffset + dwPlatformIDSize - 1sb.Append(
String.Format("{0:X2}", buffer(i))) Next i Return sb.ToString End FunctionHope this helps.
One Touch
You can not since OEM failed to include unique ID. Please consider using something else for identification purposes.
ManishMenon
thanks for your suggestions...
but this is the same code i use... for some device this code return the same ID
Andrea
deputydawg219
Hummm ....
We tested this on about 20 different handhelds (all from Symbol Technologies) and different models and the id was different everytime. Are you using a consumer-grade device If so, that may have something to do with it. Not sure ....
Have you tried maybe the SDK from the hardware manufacturer assuming one is available
Good luck.