int ExecutionManager::setJniResult(void *r) { if(mStatus != WAIT4JNI) { ALOGE("ExecutionManager does not wait for JNI result!"); return ERROR; } else { ALOGD("ExecutionManager receives JNI result!"); // TODO: set the result of the JNI execution //ALOGD("Signal the reqJniCall to continue"); // signal native thread that JNI has been received sem_post(&mJniReady); ALOGD("Continue waiting for the result of the main task (status: %s) of semaphore", strStatus(mStatus), (int)&mReplyReady); sem_wait(&mReplyReady); //if(mStatus == FINISHED) waitForThread(); ALOGD("Task seems to be continuing: %s", strStatus(mStatus)); return mStatus; } return ERROR; }
AboutDlg::AboutDlg(wxWindow* parent,wxWindowID id) { //(*Initialize(AboutDlg) wxBoxSizer* BoxSizer4; Create(parent, id, _("About"), wxDefaultPosition, wxDefaultSize, 0, _T("id")); SetClientSize(wxSize(17,16)); BoxSizer1 = new wxBoxSizer(wxVERTICAL); StaticBitmap1 = new wxStaticBitmap(this, ID_STATICBITMAP1, wxBitmap(wxImage(_T("img\\boomworks_logo.bmp"))), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICBITMAP1")); BoxSizer1->Add(StaticBitmap1, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0); BoxSizer2 = new wxBoxSizer(wxHORIZONTAL); StaticBitmap2 = new wxStaticBitmap(this, ID_STATICBITMAP2, wxBitmap(wxImage(_T("img\\SourceCounter.ico"))), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICBITMAP2")); BoxSizer2->Add(StaticBitmap2, 1, wxTOP|wxBOTTOM|wxALIGN_TOP|wxALIGN_CENTER_HORIZONTAL, 5); BoxSizer3 = new wxBoxSizer(wxVERTICAL); StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("SourceCounter"), wxDefaultPosition, wxSize(214,14), 0, _T("ID_STATICTEXT1")); BoxSizer3->Add(StaticText1, 0, wxTOP|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText2 = new wxStaticText(this, ID_STATICTEXT2, _("Unicode version 1.0.1.0"), wxDefaultPosition, wxSize(214,14), 0, _T("ID_STATICTEXT2")); BoxSizer3->Add(StaticText2, 0, wxTOP|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText4 = new wxStaticText(this, ID_STATICTEXT4, _("Label"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4")); BoxSizer3->Add(StaticText4, 0, wxTOP|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText3 = new wxStaticText(this, ID_STATICTEXT3, _("(C) 1999 - 2010 BoomWorks.Org"), wxDefaultPosition, wxSize(214,13), 0, _T("ID_STATICTEXT3")); BoxSizer3->Add(StaticText3, 0, wxTOP|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText5 = new wxStaticText(this, ID_STATICTEXT5, _("mailto:[email protected]"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT5")); BoxSizer3->Add(StaticText5, 0, wxTOP|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer4 = new wxBoxSizer(wxHORIZONTAL); BoxSizer3->Add(BoxSizer4, 1, wxBOTTOM|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText6 = new wxStaticText(this, ID_STATICTEXT6, _("Thanks to:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT6")); BoxSizer3->Add(StaticText6, 0, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5); StaticText7 = new wxStaticText(this, ID_STATICTEXT7, _("[email protected] - Korea translator"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT7")); BoxSizer3->Add(StaticText7, 0, wxLEFT|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 10); m_bmpBtnBMW = new wxBitmapButton(this, ID_BITMAPBUTTON1, wxBitmap(wxImage(_T("img\\www.boomworks.net--thumb.jpg"))), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTON1")); m_bmpBtnBMW->SetDefault(); BoxSizer3->Add(m_bmpBtnBMW, 0, wxTOP|wxLEFT|wxRIGHT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); BoxSizer3->Add(-1,-1,0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); Button1 = new wxButton(this, wxID_OK, _("&Ok"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("wxID_OK")); BoxSizer3->Add(Button1, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); BoxSizer3->Add(-1,-1,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer2->Add(BoxSizer3, 2, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_TOP|wxALIGN_CENTER_HORIZONTAL, 5); BoxSizer1->Add(BoxSizer2, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); SetSizer(BoxSizer1); BoxSizer1->SetSizeHints(this); Center(); Connect(ID_BITMAPBUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&AboutDlg::OnBtnBMWClick); Connect(wxID_OK,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&AboutDlg::OnButton1Click); //*) // Set link to boomworks.org m_pLinkBMW = new wxHyperLink(this, ID_TXT_BMW, _("http://www.boomworks.org")); BoxSizer4->Add(m_pLinkBMW, 0, wxTOP|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); // Set Version by AutoVersioning tool wxString strVersion(AutoVersion::FULLVERSION_STRING, wxConvUTF8); wxString strStatus(AutoVersion::STATUS, wxConvUTF8); StaticText2->SetLabel(_T("Version ") + strVersion + _T(" ") + strStatus); // Get wx version infomation// wxString msg = wxbuildinfo(long_f); StaticText4->SetLabel(msg); }
void UserManagerTestSuite::login_nonexisting_user() { User_Manager m; Security_Status status = m.login_user(bad_username, good_password); std::string str_status = strStatus(status); TEST_ASSERT_MSG(status==Security_Status::err_user_not_found, str_status.c_str()); }
void UserManagerTestSuite::login_existing_success() { User_Manager m; Security_Status status = m.login_user(good_username, good_password); std::string str_status = strStatus(status); TEST_ASSERT_MSG(status==Security_Status::ok_login, str_status.c_str()); }
void UserManagerTestSuite::register_existing_user() { User_Manager m; Security_Status status = m.register_user(good_username, bad_password); std::string str_status = strStatus(status); TEST_ASSERT_MSG(status==Security_Status::err_user_exists, str_status.c_str()); }
void UserManagerTestSuite::login_existing_CAPS_fail() { User_Manager m; Security_Status status = m.login_user(caps_username, caps_password); std::string str_status = strStatus(status); TEST_ASSERT_MSG(status==Security_Status::err_bad_auth, str_status.c_str()); }
void UserManagerTestSuite::register_new_user() { User_Manager m; Security_Status status = m.register_user(good_username, good_password); std::string str_status = strStatus(status); TEST_ASSERT_MSG(status==Security_Status::ok_register, str_status.c_str()); TEST_ASSERT(m.get_user()!=-1); assigned_id = m.get_user(); }
////////////////////////////////////////////////////////// // // NvOptimusDetect // // Try detecting optimus via NvAPI // ////////////////////////////////////////////////////////// bool NvOptimusDetect( void ) { if( NvAPI_Initialize() != NVAPI_OK ) { return false; } // Get and log driver info NvAPI_ShortString szDesc = "-"; NvU32 uiDriverVersion = -1; NvAPI_ShortString szBuildBranchString = "-"; NvAPI_GetInterfaceVersionString( szDesc ); NvAPI_SYS_GetDriverAndBranchVersion( &uiDriverVersion, szBuildBranchString ); WriteDebugEventAndReport( 7460, SString( "NvAPI - InterfaceVersion:'%s' DriverVersion:%d.%d Branch:'%s'", szDesc, uiDriverVersion / 100, uiDriverVersion % 100, szBuildBranchString ) ); // Get all the Physical GPU Handles NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS] = {0}; NvU32 uiGpuCount = 0; if( NvAPI_EnumPhysicalGPUs( nvGPUHandle, &uiGpuCount ) != NVAPI_OK ) { return false; } bool bFoundOptimus = false; for( NvU32 i = 0; i < uiGpuCount; i++ ) { NV_SYSTEM_TYPE SystemType = (NV_SYSTEM_TYPE)-1; // 1-Laptop 2-Desktop NV_GPU_TYPE GpuType = (NV_GPU_TYPE)-1; // 1-Integrated 2-Discrete NvAPI_ShortString szName = "-"; NvAPI_GPU_GetSystemType( nvGPUHandle[i], &SystemType ); NvAPI_GPU_GetGPUType( nvGPUHandle[i], &GpuType ); NvAPI_GPU_GetFullName( nvGPUHandle[i], szName ); SString strStatus( "NvAPI - GPU %d/%d - SystemType:%d GpuType:%d (%s)", i, uiGpuCount, SystemType, GpuType, szName ); if ( SystemType == NV_SYSTEM_TYPE_LAPTOP && GpuType == NV_SYSTEM_TYPE_DGPU ) { bFoundOptimus = true; strStatus += " FoundOptimus"; } WriteDebugEventAndReport( 7461, strStatus ); } return bFoundOptimus; }
void UINetworkManagerIndicator::updateAppearance() { /* First of all, we are hiding LED in case of 'idle' state: */ if (state() == UINetworkManagerIndicatorState_Idle && !isHidden()) hide(); /* Prepare description: */ QString strDecription; /* Check if there are any network-requests: */ if (!m_ids.isEmpty()) { /* Prepare table: */ QString strTable("<table>%1</table>"); QString strBodyItem("<tr><td>%1</td><td> </td><td>%2</td></tr>"); QString strParagraph("<p>%1</p>"); QString strBoldNobreak("<nobr><b>%1</b></nobr>"); QString strNobreak("<nobr>%1</nobr>"); QString strItalic("<i>%1</i>"); /* Prepare header: */ QString strHeader(strBoldNobreak.arg(tr("Current network operations:"))); /* Prepare table body: */ QString strBody; for (int i = 0; i < m_data.size(); ++i) { const UINetworkRequestData &data = m_data[i]; const QString &strDescription = data.description; QString strStatus(data.failed ? tr("failed", "network operation") : tr("(%1 of %2)") .arg(vboxGlobal().formatSize(data.bytesReceived)) .arg(vboxGlobal().formatSize(data.bytesTotal))); QString strBodyLine(strBodyItem.arg(strNobreak.arg(strDescription)).arg(strNobreak.arg(strStatus))); strBody += strBodyLine; } /* Compose description: */ strDecription = strParagraph.arg(strHeader + strTable.arg(strBody)) + strParagraph.arg(strNobreak.arg(strItalic.arg(tr("Double-click for more information.")))); } else strDecription = QString(); /* Set description: */ setToolTip(strDecription); /* Finally, we are showing LED in case of state is not 'idle': */ if (state() != UINetworkManagerIndicatorState_Idle && isHidden()) show(); }
BOOL CCamFrame::CreateToolbars() { #if 0 // Create the status bar m_pStatusBar = CreateStatusBar(); String_256 strStatus( _R(IDS_NO_OBJECTS_SEL) ); m_pStatusBar->SetStatusText( strStatus ); #endif CColourBar* pColourBar = new CColourBar(); if (pColourBar) { pColourBar->Create(this, 12345); wxAuiPaneInfo paneinfo; paneinfo.BottomDockable().Bottom(); paneinfo.CaptionVisible(false); m_pFrameManager->AddPane(pColourBar, paneinfo); m_pFrameManager->Update(); } // Enable alpha on XP true-color #if defined(__WXMSW__) if( wxTheApp->GetComCtl32Version() >= 600 && ::wxDisplayDepth() >= 32 ) { wxSystemOptions::SetOption( wxT("msw.remap"), 2 ); } #endif wxCommandEvent sbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_STANDARD)); OnStandardBar(sbe); wxCommandEvent tbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_TOOLBAR)); OnStandardBar(tbe); wxCommandEvent sbbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_STATUS)); OnStandardBar(sbbe); // wxCommandEvent gbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_GALLERIES)); // OnStandardBar(gbe); return TRUE; }
HRESULT CControlSurfaceProbe::GetStatusText( LPSTR pszStatus, DWORD* pdwLen ) { if (NULL == pdwLen) return E_POINTER; // TODO: Fill strStatus with a string describing the current // status of the surface, e.g., "Tracks 9-16". CString strStatus( "OK" ); // Return results to caller if (NULL == pszStatus) { *pdwLen = strStatus.GetLength() + 1; } else { TCHAR2Char(pszStatus, strStatus, *pdwLen); } return S_OK; }
QString CMFPI::GetStMediaStatus(void)// 改为 GetStMediaStatus { int ret = N_GetStatus(); if(LFS_SUCCESS != ret) { N_InitStatus(); } QString strStatus(""); if(LFS_IDC_MEDIANOTPRESENT == m_Status.media) strStatus = "NOTPRESENT"; else if(LFS_IDC_MEDIAPRESENT == m_Status.media) strStatus = "PRESENT"; else strStatus = "UNKNOWN"; LOGINFO("%s,属性,strStatus = %s",__FUNCTION__,strStatus.toStdString().c_str()); return strStatus; }
////////////////////////////////////////////////////////// // // CheckAntiVirusStatus // // Maybe warn user if no anti-virus running // ////////////////////////////////////////////////////////// void CheckAntiVirusStatus( void ) { // Get data from WMI std::vector < SString > enabledList; std::vector < SString > disabledList; GetWMIAntiVirusStatus( enabledList, disabledList ); // Get status from WSC WSC_SECURITY_PROVIDER_HEALTH health = (WSC_SECURITY_PROVIDER_HEALTH)-1; if ( _WscGetSecurityProviderHealth ) { _WscGetSecurityProviderHealth( WSC_SECURITY_PROVIDER_ANTIVIRUS, &health ); } // Dump results SString strStatus( "AV health: %s (%d)", *EnumToString( health ), health ); for ( uint i = 0 ; i < enabledList.size() ; i++ ) strStatus += SString( " [Ena%d:%s]", i, *enabledList[i] ); for ( uint i = 0 ; i < disabledList.size() ; i++ ) strStatus += SString( " [Dis%d:%s]", i, *disabledList[i] ); WriteDebugEvent( strStatus ); // Maybe show dialog if av not found if ( enabledList.empty() && health != WSC_SECURITY_PROVIDER_HEALTH_GOOD ) { bool bEnableScaremongering = ( health != WSC_SECURITY_PROVIDER_HEALTH_NOTMONITORED ); if ( bEnableScaremongering ) { const char* avProducts[] = { "antivirus", "anti-virus", "Avast", "AVG", "Avira", "NOD32", "ESET", "F-Secure", "Faronics", "Kaspersky", "McAfee", "Norton", "Symantec", "Panda", "Trend Micro", }; // Check for anti-virus helper dlls before actual scaremongering HMODULE aModules[1024]; DWORD cbNeeded; if ( EnumProcessModules( GetCurrentProcess(), aModules, sizeof(aModules), &cbNeeded) ) { DWORD cModules = cbNeeded / sizeof(HMODULE); for ( uint i = 0 ; i < cModules ; i++ ) { if( aModules[i] != 0 ) { WCHAR szModulePathFileName[1024] = L""; GetModuleFileNameExW ( GetCurrentProcess(), aModules[i], szModulePathFileName, NUMELMS(szModulePathFileName) ); SLibVersionInfo libVersionInfo; GetLibVersionInfo ( ToUTF8( szModulePathFileName ), &libVersionInfo ); for( uint i = 0 ; i < NUMELMS( avProducts ) ; i++ ) { if ( libVersionInfo.strCompanyName.ContainsI( avProducts[i] ) || libVersionInfo.strProductName.ContainsI( avProducts[i] ) ) { bEnableScaremongering = false; WriteDebugEvent( SString( "AV (module) maybe found %s [%d](%s,%s)", *WStringX( szModulePathFileName ).ToAnsi(), i, *libVersionInfo.strCompanyName, *libVersionInfo.strProductName ) ); } } } } if ( bEnableScaremongering ) WriteDebugEvent( SString( "AV Searched %d dlls, but could not find av helper", cModules ) ); } if ( bEnableScaremongering ) { std::vector < DWORD > processIdList = MyEnumProcesses(); for ( uint i = 0; i < processIdList.size (); i++ ) { DWORD processId = processIdList[i]; // Skip 64 bit processes to avoid errors if ( !Is32bitProcess ( processId ) ) continue; std::vector < SString > filenameList = GetPossibleProcessPathFilenames ( processId ); for ( uint i = 0; i < filenameList.size (); i++ ) { const SString& strProcessPathFileName = filenameList[i]; SLibVersionInfo libVersionInfo; if ( GetLibVersionInfo ( strProcessPathFileName, &libVersionInfo ) ) { for( uint i = 0 ; i < NUMELMS( avProducts ) ; i++ ) { if ( libVersionInfo.strCompanyName.ContainsI( avProducts[i] ) || libVersionInfo.strProductName.ContainsI( avProducts[i] ) ) { bEnableScaremongering = false; WriteDebugEvent( SString( "AV (process) maybe found %s [%d](%s,%s)", *strProcessPathFileName, i, *libVersionInfo.strCompanyName, *libVersionInfo.strProductName ) ); } } } } } if ( bEnableScaremongering ) WriteDebugEvent( SString( "AV Searched %d processes, but could not find av helper", processIdList.size() ) ); } } ShowNoAvDialog( g_hInstance, bEnableScaremongering ); HideNoAvDialog (); } }
void ExecutionManager::reset() { ALOGD("Current state: %s", strStatus(mStatus)); }