X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fsystem%2FFSys_SystemInfoImpl.cpp;h=8cc29b0b16f10454de321263aa86e67c7693b27a;hb=ceea15f5cc3b8211979e6bc18f11c2d188883d0e;hp=6cd8e41bcbafaaf4219716963fe20960644021f2;hpb=6cbc89f5720a845d4942b8cd60104fc0006d9ef4;p=platform%2Fframework%2Fnative%2Fappfw.git diff --git a/src/system/FSys_SystemInfoImpl.cpp b/src/system/FSys_SystemInfoImpl.cpp index 6cd8e41..8cc29b0 100644 --- a/src/system/FSys_SystemInfoImpl.cpp +++ b/src/system/FSys_SystemInfoImpl.cpp @@ -1,5 +1,4 @@ // -// Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the License); @@ -20,28 +19,39 @@ * @brief This is the implementation file for _SystemInfoImpl class. */ #include +#include + +#include +#include #include #include #include +#include +#include #include +#include #include #include #include #include -#include + +#include "FSys_Types.h" +#include "FSys_SystemClient.h" +#include "FSys_CommunicationDispatcherClient.h" using namespace std; using namespace Tizen::Base; using namespace Tizen::Base::Collection; using namespace Tizen::Io; +using namespace Tizen::Base::Utility; namespace Tizen { namespace System { -static const wchar_t* _REGISTRY_PATH = L"/tmp/osp/system_info_cache.ini"; +static const wchar_t* _REGISTRY_PATH = L"/opt/usr/etc/system_info_cache.ini"; static const wchar_t* _SYSTEM_INFO_SESSION = L"SystemInformation"; //Bluetooth @@ -130,7 +140,6 @@ static const wchar_t* _NETWORK_TYPE = L"NetworkType"; static const wchar_t* _NETWORK_EMERGENCY = L"Emergency"; static const wchar_t* _NETWORK_NO_SERVICE = L"NoService"; - //WIFI static const wchar_t* _WIFI = L"http://tizen.org/feature/network.wifi"; static const wchar_t* _WIFI_SUPPORTED = L"WiFiSupported"; @@ -148,9 +157,9 @@ static const wchar_t* _SUPPORTED = L"Supported"; static const wchar_t* _UNSUPPORTED = L"Unsupported"; static bool firstRequest = false; -static HashMap integerList; -static HashMap boolList; -static HashMap stringList; +static HashMap integerList(SingleObjectDeleter); +static HashMap boolList(SingleObjectDeleter); +static HashMap stringList(SingleObjectDeleter); void PrepareCache(void) @@ -179,7 +188,7 @@ _SystemInfoImpl::ConvertToTizen(const String& key) } else if(code == _KEYBOARD_TYPE) { - code == _INPUT_KEYBOARD_LAYOUT; + code = _INPUT_KEYBOARD_LAYOUT; } else if(code == _SCREEN_BITS_PER_PIXEL) { @@ -258,16 +267,19 @@ _SystemInfoImpl::GetSysInfo(const String& key, String& value) result r = E_OBJ_NOT_FOUND; String tizenKey = ConvertToTizen(key); + SysLog(NID_SYS, "Request Key is %ls.", key.GetPointer()); + if (firstRequest == false) { PrepareCache(); } - String* pValue = (String*)stringList.GetValue(key); + String* pValue = (String*)stringList.GetValue(tizenKey); if(pValue != null) { value = *pValue; + return E_SUCCESS; } if (key == _NETWORK_TYPE) //Compatibility @@ -368,7 +380,7 @@ _SystemInfoImpl::GetSysInfo(const String& key, String& value) value.Append(L"CDMA"); } - + r = E_SUCCESS; } else if (key == _OPENGL_ES_VERSION) { @@ -389,6 +401,7 @@ _SystemInfoImpl::GetSysInfo(const String& key, String& value) value.Append(L"2.0"); } + r = E_SUCCESS; } else if(key == _BLUETOOTH_SUPPORTED) { @@ -398,6 +411,7 @@ _SystemInfoImpl::GetSysInfo(const String& key, String& value) value = _SUPPORTED; else value = _UNSUPPORTED; + r = E_SUCCESS; } else if (key == _GPS_SUPPORTED) { @@ -407,6 +421,7 @@ _SystemInfoImpl::GetSysInfo(const String& key, String& value) value = _SUPPORTED; else value = _UNSUPPORTED; + r = E_SUCCESS; } else if (key == _WIFI_SUPPORTED) { @@ -416,6 +431,7 @@ _SystemInfoImpl::GetSysInfo(const String& key, String& value) value = _SUPPORTED; else value = _UNSUPPORTED; + r = E_SUCCESS; } else if (key == _WAC_VERSION) { @@ -426,36 +442,102 @@ _SystemInfoImpl::GetSysInfo(const String& key, String& value) { r = E_OBJ_NOT_FOUND; } + else if (tizenKey == _DUID) + { + r = GetFromRegistry(tizenKey, value); + + if(r != E_SUCCESS || value == L"ERROR") + { + ArrayList requestMessage; + ArrayList responseMessage; + + _CommunicationDispatcherClient* pCommunicationDispatcherClient = _CommunicationDispatcherClient::GetInstance(); + + _IpcClient* pIpcClient = pCommunicationDispatcherClient->GetIpcClient(); + SysTryReturn(NID_SYS, pIpcClient != null, E_OUT_OF_MEMORY, r, "It is failed to create IPC instance."); + + requestMessage.Construct(); + responseMessage.Construct(); + + String serviceId(_SYSTEM_SERVICE_ID); + String commandId(L"osp.system.command.get.duid.internal"); + + requestMessage.Add(serviceId); + requestMessage.Add(commandId); + + unique_ptr pMsg(new (std::nothrow) IoService_Request(requestMessage, &responseMessage)); + SysTryReturnResult(NID_SYS, pMsg != null, E_OUT_OF_MEMORY, "It is failed to create Ipc message"); + + r = pIpcClient->SendRequest(pMsg.get()); + SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "It is failed to send ipc message. [%s]", GetErrorMessage(r)); + + String* pResult = (String*)responseMessage.GetAt(_SYSTEM_RESPONSE_DATA); + String* pDuid = (String*)responseMessage.GetAt(_SYSTEM_RESPONSE_DATA+1); + + SysTryReturn(NID_SYS, pResult != null, r = E_SYSTEM, r, "It is failed to receive result on IPC response message."); + SysTryReturn(NID_SYS, pDuid != null, r = E_SYSTEM, r, "It is failed to receive IMEI value on IPC response message."); + + SysTryReturn(NID_SYS, *pResult != _SYSTEM_RESULT_PRIVILEGED, r = E_PRIVILEGE_DENIED, r, "It is failed to get privilege."); + SysTryReturn(NID_SYS, *pResult == _SYSTEM_RESULT_OK, r = E_SYSTEM, r, "It is failed to get DUID value."); + + value = *pDuid; + + responseMessage.RemoveAll(true); + } + } else { r = GetFromRegistry(tizenKey, value); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_OBJ_NOT_FOUND, "It is failed to get the key[%ls]", tizenKey.GetPointer()); - r = E_SUCCESS; + + if(r != E_SUCCESS) + { + char* pStringValue = null; + String tKey; + tizenKey.SubString(7, tKey); + SysTryReturnResult(NID_SYS, tKey.GetLength() > 0, E_OBJ_NOT_FOUND, "Required key should be longer than 0."); + + ClearLastResult(); + unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); + r = GetLastResult(); + SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); + + int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); + if (ret != SYSTEM_INFO_ERROR_NONE) + { + ret = system_info_get_custom_string(systemKey.get(), &pStringValue); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + } + r = StringUtil::Utf8ToString(pStringValue, value); + free(pStringValue); + r = E_SUCCESS; + } } if( r == E_SUCCESS) { - stringList.Add(new String(key), new String(value)); + stringList.Add(new String(tizenKey), new String(value)); } return r; } - result _SystemInfoImpl::GetSysInfo(const String& key, int& value) { result r = E_SUCCESS; String tizenKey = ConvertToTizen(key); + SysLog(NID_SYS, "Request Key is %ls.", key.GetPointer()); + if (firstRequest == false) { PrepareCache(); } - Integer* pValue = (Integer*)integerList.GetValue(key); + Integer* pValue = (Integer*)integerList.GetValue(tizenKey); if(pValue != null) { value = pValue->value; + return E_SUCCESS; } if (key == _CAMERA_COUNT) @@ -472,77 +554,127 @@ _SystemInfoImpl::GetSysInfo(const String& key, int& value) cameraCount++; value = cameraCount; - } + } else { r = GetFromRegistry(tizenKey, value); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_OBJ_NOT_FOUND, "It is failed to get the key[%ls]", tizenKey.GetPointer()); + if(r != E_SUCCESS || tizenKey == _SCREEN_WIDTH || tizenKey == _SCREEN_HEIGHT || tizenKey == _SCREEN_DPI) + { + int ret = 0; + String tKey; + + tizenKey.SubString(7, tKey); + SysTryReturnResult(NID_SYS, tKey.GetLength() > 0, E_OBJ_NOT_FOUND, "Required key should be longer than 0."); + + ClearLastResult(); + unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); + r = GetLastResult(); + SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); + + ret = system_info_get_platform_int(systemKey.get(), &value); + if (ret != SYSTEM_INFO_ERROR_NONE) + { + ret = system_info_get_custom_int(systemKey.get(), &value); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, + "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + } + r = E_SUCCESS; + } } if(r == E_SUCCESS) { - integerList.Add(new String(key), new Integer(value)); + integerList.Add(new String(tizenKey), new Integer(value)); } - + return r; } - result _SystemInfoImpl::GetSysInfo(const String& key, long long& value) { return E_OBJ_NOT_FOUND; } - result _SystemInfoImpl::GetSysInfo(const String& key, double& value) { return E_OBJ_NOT_FOUND; } - result _SystemInfoImpl::GetSysInfo(const String& key, bool& value) { result r = E_SUCCESS; String tizenKey = ConvertToTizen(key); + SysLog(NID_SYS, "Request Key is %ls.", key.GetPointer()); + if (firstRequest == false) { PrepareCache(); } - Boolean* pValue = (Boolean*)boolList.GetValue(key); + Boolean* pValue = (Boolean*)boolList.GetValue(tizenKey); if(pValue != null) { value = pValue->value; + return E_SUCCESS; } - r = GetFromRegistry(tizenKey, value); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_OBJ_NOT_FOUND, "It is failed to get the key[%ls]", tizenKey.GetPointer()); + if(r != E_SUCCESS) + { + String tKey; + tizenKey.SubString(7, tKey); + SysTryReturnResult(NID_SYS, tKey.GetLength() > 0, E_OBJ_NOT_FOUND, "Required key should be longer than 0."); + + ClearLastResult(); + unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); + r = GetLastResult(); + SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); + + bool supported = false; + int ret = system_info_get_platform_bool(systemKey.get(), &supported); + if(ret != SYSTEM_INFO_ERROR_NONE) + { + ret = system_info_get_custom_bool(systemKey.get(), &supported); + if (ret != SYSTEM_INFO_ERROR_NONE) + { + String screenKey(L"http://tizen.org/feature/screen.size"); + String requiredKey; + tizenKey.SubString(0, screenKey.GetLength(), requiredKey); + + if(requiredKey == screenKey) + { + value = false; + } + } + } + + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + value = supported; + r = E_SUCCESS; + } if(r == E_SUCCESS) { - boolList.Add(new String(key), new Boolean(value)); + boolList.Add(new String(tizenKey), new Boolean(value)); } return r; } - result _SystemInfoImpl::GetSysInfo(const String& key, UuId& value) { return E_OBJ_NOT_FOUND; } - Collection::IList* _SystemInfoImpl::GetSysInfoValuesN(const String& key, SystemInfoValueType type) -{ +{ SetLastResult(E_OBJ_NOT_FOUND); return null; } @@ -554,7 +686,26 @@ _SystemInfoImpl::GetPlatformVersion(String& platformVersion) String tizenKey(_PLATFORM_VERSION); r = GetFromRegistry(tizenKey, platformVersion); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to get the key[%ls]", tizenKey.GetPointer()); + + if(r != E_SUCCESS) + { + char* pStringValue = null; + String tKey; + tizenKey.SubString(7, tKey); + SysTryReturnResult(NID_SYS, tKey.GetLength() > 0, E_SYSTEM, "Required key should be longer than 0."); + + ClearLastResult(); + unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); + r = GetLastResult(); + SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); + + int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + + r = StringUtil::Utf8ToString(pStringValue, platformVersion); + free(pStringValue); + r = E_SUCCESS; + } return r; } @@ -565,7 +716,26 @@ _SystemInfoImpl::GetBuildInfo(String& buildInfo) String tizenKey(_BUILD_STRING); r = GetFromRegistry(tizenKey, buildInfo); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to get the key[%ls]", tizenKey.GetPointer()); + + if(r != E_SUCCESS) + { + char* pStringValue = null; + String tKey; + tizenKey.SubString(7, tKey); + SysTryReturnResult(NID_SYS, tKey.GetLength() > 0, E_SYSTEM, "Required key should be longer than 0."); + + ClearLastResult(); + unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); + r = GetLastResult(); + SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); + + int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + + r = StringUtil::Utf8ToString(pStringValue, buildInfo); + free(pStringValue); + r = E_SUCCESS; + } return r; } @@ -576,7 +746,26 @@ _SystemInfoImpl::GetNativeApiVersion(String& nativeApiVersion) String tizenKey(_PLATFORM_NATIVE_API_VERSION); r = GetFromRegistry(tizenKey, nativeApiVersion); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to get the key[%ls]", tizenKey.GetPointer()); + + if(r != E_SUCCESS) + { + char* pStringValue = null; + String tKey; + tizenKey.SubString(7, tKey); + SysTryReturnResult(NID_SYS, tKey.GetLength() > 0, E_SYSTEM, "Required key should be longer than 0."); + + ClearLastResult(); + unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); + r = GetLastResult(); + SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); + + int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + + r = StringUtil::Utf8ToString(pStringValue, nativeApiVersion); + free(pStringValue); + r = E_SUCCESS; + } return r; } @@ -587,7 +776,26 @@ _SystemInfoImpl::GetWebApiVersion(String& webApiVersion) String tizenKey(_PLATFORM_WEB_API_VERSION); r = GetFromRegistry(tizenKey, webApiVersion); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to get the key[%ls]", tizenKey.GetPointer()); + + if(r != E_SUCCESS) + { + char* pStringValue = null; + String tKey; + tizenKey.SubString(7, tKey); + SysTryReturnResult(NID_SYS, tKey.GetLength() > 0, E_SYSTEM, "Required key should be longer than 0."); + + ClearLastResult(); + unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); + r = GetLastResult(); + SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); + + int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + + r = StringUtil::Utf8ToString(pStringValue, webApiVersion); + free(pStringValue); + r = E_SUCCESS; + } return r; } @@ -596,14 +804,41 @@ _SystemInfoImpl::GetImei(String& imei) { result r = E_SUCCESS; + int ret = 0; + TapiHandle* handle = null; + int time_count = 0; + int status = 0; + + handle = tel_init(null); + SysTryReturnResult(NID_SYS, handle != null, E_SYSTEM, "It is failed to get handle of telephony."); + while(time_count < 30) //Wait 30 second. + { + ret = tel_check_modem_power_status(handle, &status); + SysLog(NID_SYS, "Modem check result is %d, status is %d.", handle, status); + if(ret != TAPI_API_SUCCESS) + { + SysLogException(NID_SYS, E_SYSTEM, "It is failed to get Modem status."); + tel_deinit(handle); + return E_SYSTEM; + } + + if(status == 0) + { + break; + } + + usleep(1000000); + time_count++; + } + tel_deinit(handle); + ArrayList requestMessage; ArrayList responseMessage; - unique_ptr<_IpcClient> pIpcClient (new (std::nothrow) _IpcClient()); - SysTryReturn(NID_SYS, pIpcClient != null, E_OUT_OF_MEMORY, r, "It is failed to create IPC instance."); + _CommunicationDispatcherClient* pCommunicationDispatcherClient = _CommunicationDispatcherClient::GetInstance(); - r = pIpcClient->Construct(_COMMUNICATION_DISPATCHER_IPC_ID); - SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "It is failed to create IpcClient. [%s]", GetErrorMessage(r)); + _IpcClient* pIpcClient = pCommunicationDispatcherClient->GetIpcClient(); + SysTryReturn(NID_SYS, pIpcClient != null, E_OUT_OF_MEMORY, r, "It is failed to create IPC instance."); requestMessage.Construct(); responseMessage.Construct(); @@ -620,16 +855,18 @@ _SystemInfoImpl::GetImei(String& imei) r = pIpcClient->SendRequest(pMsg.get()); SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "It is failed to send ipc message. [%s]", GetErrorMessage(r)); - unique_ptr pResult((String*)responseMessage.GetAt(_SYSTEM_RESPONSE_DATA)); - unique_ptr pImei((String*)responseMessage.GetAt(_SYSTEM_RESPONSE_DATA+1)); + String* pResult = (String*)responseMessage.GetAt(_SYSTEM_RESPONSE_DATA); + String* pImei = (String*)responseMessage.GetAt(_SYSTEM_RESPONSE_DATA+1); - SysTryReturnResult(NID_SYS, pResult != null, E_SYSTEM, "It is failed to receive result on IPC response message."); - SysTryReturnResult(NID_SYS, pImei != null, E_SYSTEM, "It is failed to receive IMEI value on IPC response message."); + SysTryReturn(NID_SYS, pResult != null, r = E_SYSTEM, r, "It is failed to receive result on IPC response message."); + SysTryReturn(NID_SYS, pImei != null, r = E_SYSTEM, r, "It is failed to receive IMEI value on IPC response message."); - SysTryReturnResult(NID_SYS, *pResult != _SYSTEM_RESULT_PRIVILEGED, E_PRIVILEGE_DENIED, "It is failed to get privilege."); - SysTryReturnResult(NID_SYS, *pResult == _SYSTEM_RESULT_OK, E_SYSTEM, "It is failed to get IMEI value."); + SysTryReturn(NID_SYS, *pResult != _SYSTEM_RESULT_PRIVILEGED, r = E_PRIVILEGE_DENIED, r, "It is failed to get privilege."); + SysTryReturn(NID_SYS, *pResult == _SYSTEM_RESULT_OK, r = E_SYSTEM, r, "It is failed to get IMEI value."); imei = *pImei; + responseMessage.RemoveAll(true); + return r; } @@ -641,10 +878,10 @@ _SystemInfoImpl::GetFromRegistry(const String& key, String& value) String valStr; r = _reg.Construct(_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - SysTryReturnResult(NID_SYS, r == E_SUCCESS , r, " RegistryImpl construct It is failed"); + SysTryReturnResult(NID_SYS, r == E_SUCCESS , r, " RegistryImpl construct is failed"); r = _reg.GetValue(_SYSTEM_INFO_SESSION, key, valStr); - SysTryReturnResult(NID_SYS, r == E_SUCCESS , r, " Registry GetValue It is failed"); + SysTryReturnResult(NID_SYS, r == E_SUCCESS , r, " Registry GetValue is failed, %ls", key.GetPointer()); if(valStr == L"true" || valStr == L"false") { @@ -664,14 +901,14 @@ _SystemInfoImpl::GetFromRegistry(const String& key, int& value) result r = E_SUCCESS; _RegistryImpl _reg; String valStr; + r = _reg.Construct(_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " RegistryImpl construct It is failed"); + SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " RegistryImpl construct is failed"); r = _reg.GetValue(_SYSTEM_INFO_SESSION, key, valStr); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " Registry GetValue It is failed"); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, " Registry GetValue It is failed"); + SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " Registry GetValue is failed, %ls", key.GetPointer()); r = Integer::Parse(valStr, value); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_OBJ_NOT_FOUND, " Integer::Parse() It is failed"); + SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_OBJ_NOT_FOUND, " Integer::Parse() is failed"); return E_SUCCESS; } @@ -681,12 +918,12 @@ _SystemInfoImpl::GetFromRegistry(const String& key, bool& value) result r = E_SUCCESS; _RegistryImpl _reg; String valStr; + r = _reg.Construct(_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " RegistryImpl construct It is failed"); + SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " RegistryImpl construct is failed"); r = _reg.GetValue(_SYSTEM_INFO_SESSION, key, valStr); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " Registry GetValue It is failed"); - SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, " Registry GetValue It is failed"); + SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, " Registry GetValue is failed, [%ls]", key.GetPointer()); if(valStr == L"true") { value = true; @@ -701,6 +938,7 @@ _SystemInfoImpl::GetFromRegistry(const String& key, bool& value) } return E_SUCCESS; } + _SystemInfoImpl* _SystemInfoImpl::GetInstance(SystemInfo& systeminfo) {