Main Topics
Browse All TopicsI use the following code to get the serial number for my WM5/6 devices:
typedef int (__cdecl *MYPROC)(LPBYTE, DWORD, DWORD, LPBYTE, DWORD *);
MYPROC ProcAdd;
// Attemp to load aygshell.dll
HMODULE hLib = LoadLibrary(_T("coredll.dl
if (hLib)
{
ProcAdd = (MYPROC)GetProcAddress(hLi
if(ProcAdd)
{
HRESULT hr = NOERROR;
const GUID bApplicationData1 = { 0x8d552bd1, 0xe232, 0x4107, { 0xb7,
0x2d, 0x38, 0xb6, 0xa4, 0x72, 0x64, 0x39 } };
const DWORD cbApplicationData1 = sizeof (bApplicationData1);
// Buffers to hold the two device IDs we are going to generate
BYTE g_bDeviceID1[GETDEVICEUNIQ
// Lengths of the returned device IDs
DWORD g_cbDeviceID1;
g_cbDeviceID1 = GETDEVICEUNIQUEID_V1_OUTPU
hr = ProcAdd (reinterpret_cast<LPBYTE>(
&bApplicationData1)), cbApplicationData1,GETDEVI
g_bDeviceID1,
&g_cbDeviceID1);
TCHAR szDeviceID[(GETDEVICEUNIQU
if (SUCCEEDED (DeviceID2String (g_bDeviceID1, g_cbDeviceID1, szDeviceID,
ARRAYSIZE (szDeviceID))))
{
sSerialNo = szDeviceID;
}
}
else
{
AfxMessageBox(_T("GetSeria
sSerialNo.Empty();
}
CloseHandle(hLib);
This works fine in WM5/6 but in PPC2003 it fails here:
ProcAdd = (MYPROC)GetProcAddress(hLi
if(ProcAdd)
{
blah blah
}
Why is this and how can I go about it?
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: pgnatyukPosted on 2009-07-01 at 21:00:37ID: 24760380
You can retrieve the same data by using KernelIOControl API with IOCTL_HAL_GET_DEVICEID. PPC2003 does have the privilliged mode, so it is possible to call such API without any problem:
http://msdn.micros oft.com/en -us/librar y/aa446562 .aspx
http://msdn.microsoft.com/ en-us/libr ary/ms8806 43.aspx
http://forum.soft32.com/pd a/device-i d-unique-d evice-ftop ict53543.h tml
Other tricks about the subject:
1. GetDeviceCaps - you can retrieve OEM info and use it.
2. Phone number or IMEI if it is phone enabled PDA.
3. You can retrieve the serial number of the SD-card.
4. You can generate yourself a unique number and save on a persistent storage.