GeMachineUID Source

This question is answered

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?

Verified Answer
All Replies
  • Good morning  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 [1], I got:

    --

    [1] Workabout Pro G2 System Properties:

    Windows CE - 5.0
    Build type - Release
    Boot code - F010w
    OS code - H050p
    Power Micro code - F010w
    Keyboard Micro code - F010w
    Scanner Beeper Firmware - N/A
    Processor - PXA270
    Processor Speed - 520 MHz
    Ram - 128 MB
    Flash - 128 MB
    Scanner - Symbol 1223 HP
    Scanner Firmware - NBRSCAAH
    Keyboard - 25 key
    Display - Sony
    Orientation - Portrait
    MLB type - ES3
    MLB Serial - 8173V019661
    Term Serial - 8273W026927
    MAC Address -   
      00:00:00:00:00:00 - USB Cable
    Bluetooth - Installed (enabled)
    Bluetooth - LMP: 2.1958
    Bluetooth - HCI: 2.1958
    PCM/CF Slots - Empty Slot
    MMC/SD Slot - Empty Slot

    I do hope this helps.
    Kind regards,

    Jacques

  • 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".

    Update:

    Same result on an IKÖN with WM 6.1.

  • Good afternoon ,

    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

    Kind regards,
    Jacques

  • Thanks, worked on all tested devices. Great piece of code.

  • Good morning ,

    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.

    Kind regards,
    Jacques