Skip to content

Commit

Permalink
Support Motorola RCM_GetUniqueUnitId() API to find UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bougard committed Jan 11, 2019
1 parent f544344 commit eb88be1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/inventory/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 5 additions & 0 deletions src/sdk-extracted.h
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit eb88be1

Please sign in to comment.