I found out, that the method SystemInformation.GeMachineUID in PsionTeklogixNet.dll uses the Method system_GetMachineUniqueIdentifier from PtxSdkCommon.dll to get the serial number of the device. I don't want to add a reference to either PsionTeklogixNet.dll or PtxSdkCommon.dll, because i only use the Method GeMachineUID from my library and if i always ship those dlls, projects using my lib will grow 800KB additional Space. Can I get a source snippet of the method system_GetMachineUniqueIdentifier? Or is the source somewhere available?
Good afternoon cosyskruzel,
As depicted here, the below solution should run against both our CE and Windows Mobile 6.x product ranges
VS2008 CSharp Get Device Hardware And Term Serial Numbers
Good morning cosyskruzel and welcome to the community!
The below VS2008 C# solution illustrates how to programmatically retrieve the device name and device ID by calling the KernelIoControl function with IOCTL_HAL_GET_DEVICEID.
VS2008 CSharp Get Device ID project sample
E.g.Upon execution of this application against a Workabout Pro G2 CE 5.0 device , I got:
 Workabout Pro G2 System Properties:
Windows CE - 5.0Build type - ReleaseBoot code - F010wOS code - H050pPower Micro code - F010wKeyboard Micro code - F010wScanner Beeper Firmware - N/AProcessor - PXA270Processor Speed - 520 MHzRam - 128 MBFlash - 128 MBScanner - Symbol 1223 HPScanner Firmware - NBRSCAAHKeyboard - 25 keyDisplay - SonyOrientation - PortraitMLB type - ES3MLB Serial - 8173V019661Term Serial - 8273W026927MAC Address - 00:00:00:00:00:00 - USB CableBluetooth - Installed (enabled)Bluetooth - LMP: 2.1958Bluetooth - HCI: 2.1958PCM/CF Slots - Empty SlotMMC/SD Slot - Empty Slot
I do hope this helps.Kind regards,
Thanks for the source provided. On a Windows Ce 5.0 like the Neo it works like a charm, but if i try your sample on a Workabout Pro G2 WM6.1 Prof the serials can not be resolved.
(Screen on the left in Release Mode. Screen on the right Debug mode)
The content of OutputBuffer in my case is "2400000014000000080000001C00000006000000A0FF09FF06FFFFFF0030592D19B50000".
Same result on an IKÖN with WM 6.1.
Thanks, worked on all tested devices. Great piece of code.
Good morning cosyskruzel,
Thank you very much for the follow up and update.
The reason the code I shared with you yesterday did not work when executed against your Windows Mobile 6.x comes from the fact that the IOCTL_HAL_GET_DEVICEID is supported by Windows Embedded CE only.