/** * Finds the unique ID of this PDA */ void ReadAssetNumber() { if (ReadCompaqID()) { LogStartUp(_T("Asset ID: %s (compaq)"), asset_number); } else if (ReadUUID()) { LogStartUp(_T("Asset ID: %s (uuid)"), asset_number); } else { _tcscpy(asset_number, _T("AAA")); LogStartUp(_T("Asset ID: %s (fallback)"), asset_number); } }
/** * Finds the unique ID of this PDA */ void ReadAssetNumber(void) { TCHAR val[MAX_PATH]; val[0]= _T('\0'); memset(asset_number, 0, MAX_LOADSTRING * sizeof(TCHAR)); // JMW clear this first just to be safe. #ifndef _WIN32_WCE return; #endif Profile::Get(szProfileLoggerID, val, 100); int ifound = 0; int len = _tcslen(val); for (int i = 0; i < len; i++) { if (((val[i] >= _T('A')) && (val[i] <= _T('Z'))) || ((val[i] >= _T('0')) && (val[i] <= _T('9')))) { asset_number[ifound]= val[i]; ifound++; } if (ifound >= 3) { LogStartUp(_T("Asset ID: %s (reg)"), asset_number); return; } } if(asset_number[0] != '\0') { LogStartUp(_T("Asset ID: %s (?)"), asset_number); return; } ReadCompaqID(); if(asset_number[0] != '\0') { LogStartUp(_T("Asset ID: %s (compaq)"), asset_number); return; } ReadUUID(); if(asset_number[0] != '\0') { LogStartUp(_T("Asset ID: %s (uuid)"), asset_number); return; } asset_number[0]= _T('A'); asset_number[1]= _T('A'); asset_number[2]= _T('A'); LogStartUp(_T("Asset ID: %s (fallback)"), asset_number); return; }
void ReadAssetNumber() { #ifdef _WIN32_WCE if (ReadCompaqID()) { LogFormat(_T("Asset ID: %s (compaq)"), asset_number); } else if (ReadUUID()) { LogFormat(_T("Asset ID: %s (uuid)"), asset_number); } else { #endif _tcscpy(asset_number, _T("AAA")); #ifdef _WIN32_WCE LogFormat(_T("Asset ID: %s (fallback)"), asset_number); } #endif }
/** * Finds the unique ID of this PDA */ void ReadAssetNumber(void) { TCHAR val[MAX_PATH]; val[0]= _T('\0'); memset(strAssetNumber, 0, MAX_LOADSTRING*sizeof(TCHAR)); // JMW clear this first just to be safe. StartupStore(TEXT("Asset ID: ")); #ifdef WINDOWSPC return; #endif GetRegistryString(szRegistryLoggerID, val, 100); int ifound=0; int len = _tcslen(val); for (int i=0; i< len; i++) { if (((val[i] >= _T('A'))&&(val[i] <= _T('Z'))) ||((val[i] >= _T('0'))&&(val[i] <= _T('9')))) { strAssetNumber[ifound]= val[i]; ifound++; } if (ifound>=3) { StartupStore(strAssetNumber); StartupStore(TEXT(" (reg)\n")); return; } } if(strAssetNumber[0] != '\0') { StartupStore(strAssetNumber); StartupStore(TEXT(" (?)\n")); return; } ReadCompaqID(); if(strAssetNumber[0] != '\0') { StartupStore(strAssetNumber); StartupStore(TEXT(" (compaq)\n")); return; } ReadUUID(); if(strAssetNumber[0] != '\0') { StartupStore(strAssetNumber); StartupStore(TEXT(" (uuid)\n")); return; } strAssetNumber[0]= _T('A'); strAssetNumber[1]= _T('A'); strAssetNumber[2]= _T('A'); StartupStore(strAssetNumber); StartupStore(TEXT(" (fallback)\n")); return; }