diff --git a/src/inventory/board.c b/src/inventory/board.c index e6d702a..f329d21 100644 --- a/src/inventory/board.c +++ b/src/inventory/board.c @@ -349,6 +349,40 @@ LPSTR getUUID(BOOL tryDeprecated) DebugError("Can't load coredll.dll"); } + if (!uuidlen) + { + // Get Motorola UniqueUnitId if available + HINSTANCE hOEMDll = LoadLibrary(wMOTOROLA_DLL); + if (hOEMDll != NULL) + { + FARPROC RCM_GetUniqueUnitId = NULL; + + Debug2("Loading Motorola GetUniqueUnitId API..."); + RCM_GetUniqueUnitId = GetProcAddress( hOEMDll, L"RCM_GetUniqueUnitId" ); + if (RCM_GetUniqueUnitId == NULL) + DebugError("Can't import Motorola GetUniqueUnitId() API"); + else + { + DWORD ret; + ret = RCM_GetUniqueUnitId( (LPUNITID)&uuid ); + if (ret != E_RCM_SUCCESS) + { + DebugError("Motorola GetUniqueUnitId() API returned: %x", ret); + } + else + { + uuidlen = sizeof(UNITID); + } + RCM_GetUniqueUnitId = NULL; + } + + // Free DLL + FreeLibrary(hOEMDll); + } + else + DebugError("Can't load "sMOTOROLA_DLL" DLL"); + } + // Eventually try deprecated method if (!uuidlen) { diff --git a/src/sdk-extracted.h b/src/sdk-extracted.h index 47e52f4..14f467e 100644 --- a/src/sdk-extracted.h +++ b/src/sdk-extracted.h @@ -50,6 +50,11 @@ typedef ELECTRONIC_SERIAL_NUMBER FAR * LPELECTRONIC_SERIAL_NUMBER; // Get Electronic Serial Number DWORD WINAPI RCM_GetESN(LPELECTRONIC_SERIAL_NUMBER lpESN); // Pointer to ESN structure to fill +// Get Device Unique ID +typedef BYTE UNITID[8]; +typedef UNITID FAR * LPUNITID; +DWORD RCM_GetUniqueUnitId(LPUNITID lpUnitId); + #define VOS_WINDOWSCE 0x00050000L