PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Pocket PC Serial Numbers

I thought that each Pocket PC had a unique hardware serial number, but from what I've been able to gather they have that capability but no OEM implemented it. Is that true?

Dan East
Well, dunno, the only things I know are:
  • My casio got some kind of serial number on its back
  • I always thought it was in Settings/System/Info - but there isnt!

Sorry, but it doesnt seem so... :(
Okay, my Ipaq has a control panel applet called Asset Viewer under the System tab. It contains the serial number, and it matches that on the back of my device. Is Asset Viewer unique to iPaq?

Dan East
Here's where I read that the devices do not have unique hardware serial numbers:
http://www.microsoft.com/mobile/developer/technicalarticles/devfaqs.asp

Dan East
IOCTL_HAL_GET_DEVICEID
Thanks! I knew there was an IOCTL for it, but couldn't find it. My next problem is that I can't find the definition for IOCTL_HAL_GET_DEVICEID in any of my SDKs. Do you have a resource for that? Thanks again!

Dan East
The MSDN docs say it's in pkfuncs.h.  I don't seem to have that either, as it's probably a Platform Builder file.  You might try downloading the newly available CE 3.0 source code from the MS website here.
Moose or Chuck · 27 Jul 2001, 20:50 UTC
Asset View- what? I don't have one of those thingies on my Casio. It must be better, can I have it? :)
Chris Edwards · 27 Jul 2001, 20:54 UTC
it's only for 1337 iPAQ's
Moose or Chuck · 27 Jul 2001, 20:58 UTC
I feel real left out now~
i dont have it either, but i do have a arm device, how about someone sends it to me and we will see if it works? :)
If anyone knows the value of IOCTL_HAL_GET_DEVICEID then please post it. I need it ASAP! Thanks!

Dan East
I found it on usenet:

[fixed]#define IOCTL_HAL_GET_DEVICEID CTL_CODE(FILE_DEVICE_HAL, 21,
METHOD_BUFFERED, FILE_ANY_ACCESS)[/fixed]

Dan East
hmm...when trying it out it gave me errors. Most of the things was undefined. Tell me Dan, how do I get such a thing working?
Everything you need should be in winioctl.h.

Okay, here's what I've been able to determine. The DEVICEID IOCTL is not used by the OEMs at this time.
However you can use IOCTL_HAL_GET_UUID IOCTL to get the iPaq's serial number. iPaq also provides a good wrapper SDK that lets you get the ID with a single function call:
http://csa.compaq.com/CSA_For_iPAQ_Developers_CD.shtml
I noted that when using the UUID IOCTL directly with the iPaq the result is not in the same sequence as the real serial number. I got this result (ABCDEFGHIJKL is the correct order):
DCBAFEHGIJKL
So I guess you would have to correctly sequence that result if you use UUID directly. The iPaq SDK function CPQInfoGetSerialNo() returns the exact serial number as found on the back of the device.

From all the searching I've done it doesn't appear that anyone has found a method of obtaining the Device ID on a Casio Pocket PC. Someone said that they were able to use the UUID IOCTL with a Casio, but it has also been reported that it will not work on an E-125.
If anyone finds a method for accessing the serial number on a Casio or HP Please post that information here or email me.

Here's the definition for the UUID IOCTL:

[fixed]#define IOCTL_HAL_GET_UUID CTL_CODE(FILE_DEVICE_HAL, 13,   METHOD_BUFFERED, FILE_ANY_ACCESS)[/fixed]

Dan East
Here's a sample using the UUID IOCTL. An example I saw on the web showed that it returns a UNICODE value, but it does not on the iPaq, so you have to convert it.
First off, you need to prototype the KernelIoControl function:
[fixed]
extern "C" BOOL KernelIoControl (
DWORD dwIoControlCode,
LPVOID lpInBuf,
DWORD nInBufSize,
LPVOID lpOutBuf,
DWORD nOutBufSize,
LPDWORD lpBytesReturned );[/fixed]

Here it is:
[fixed]
char rgtcAsset[64];
unsigned long Len=sizeof(rgtcAsset);
memset(rgtcAsset, 0, Len);
if (KernelIoControl(IOCTL_HAL_GET_UUID, NULL, 0, (LPVOID)rgtcAsset, Len, &Len)) {
 TCHAR buf[64];
 MultiByteToWideChar(CP_ACP, NULL, rgtcAsset, -1, buf, sizeof(buf)/sizeof(TCHAR));

 //hopefully buf now contains the device's SN.
}
[/fixed]

Don't forget to use the IOCTL_HAL_GET_UUID definition in the previous post.

If anyone would take the time to see if that works with the Casios and HPs it would be very cool...

Dan East
Moose or Chuck · 31 Jul 2001, 18:01 UTC
At which time we send buf to Microsoft so they can create a database of users and rule the world yet again.