#ifndef __DEVICEINFO__H__ #define __DEVICEINFO__H__ // this module gets information from the device which can be used // to identify the type of device we are running on #include "stringutils.h" #include "cenk.h" #include "cever_deps.h" #define HTC_TYPHOON 0 #define HTC_STARTREK 1 #define HTC_HERALD 2 #define HTC_DIAMOND 3 #define HTC_KAISER 4 #define HTC_VIVA 5 #define HTC_TOPAZ 6 #define HTC_PHOTON 7 #define MOTO_ES400 8 enum paramflags { OEMNAMEBIT, PROCNAMEBIT, CORENAMEBIT, ROMVERSIONBIT, PLATFORMTYPEBIT, DEVTYPEBIT }; static inline bool ReadRegistryString(HKEY hRoot, const std::string& regpath, const std::string& keyname, std::string& value) { DWORD rc=0; HKEY hkey= NULL; rc= RegOpenKeyEx(hRoot, ToTString(regpath).c_str(), 0, 0, &hkey); if (rc) return false; std::tstring tvalue; while (true) { tvalue.resize(tvalue.size()+256); DWORD maxsize= tvalue.size()*sizeof(tvalue[0]); DWORD valtype; rc= RegQueryValueEx(hkey, ToTString(keyname).c_str(), NULL, &valtype, (BYTE*)&tvalue[0], &maxsize); if (rc==0) break; if (rc!=ERROR_MORE_DATA) { RegCloseKey(hkey); return false; } } RegCloseKey(hkey); value= ToString(&tvalue[0]); return true; } class deviceinfo { private: int _flags; int _devtype; std::string _oemname; std::string _procname; std::string _corename; std::string _romversion; std::string _platformtype; bool isvalid(int flag) { return _flags & (1<