コード例 #1
0
BOOL CExtendedCPU6Intel::OnSetActive()
   {
    CPUregs regs;
    GetAndReport(0x80000006, regs);

    ECX6x ECX;
    ECX.w = regs.ECX;
    
    SETWINDOWBIT(LineSize, ECX, Intel);
    SETWINDOWBIT(Reserved1, ECX, Intel);
    SETWINDOWHEX(Associativity, ECX, Intel, 2);
    SETWINDOWBIT(CacheSize, ECX, Intel);

    CString s;
    //    s.Format(_T("%d"), ECX.bits.CacheSize * 1024);
    s = FormatWithCommas(ECX.Intel.CacheSize * 1024);
    c_CacheSizeValue.SetWindowText(s);
    
    s.LoadString(IDS_L2_ASSOCIATIVITY_00H + ECX.Intel.Associativity);
    if(s.IsEmpty())
       c_L2Decoded.ShowWindow(SW_HIDE);
    else
       { /* has value */
        c_L2Decoded.SetWindowText(s);
        c_L2Decoded.ShowWindow(SW_SHOW);
       } /* has value */
    return CLeaves::OnSetActive();
   }
コード例 #2
0
void CGnutellaFileTransferDlg::ReportStatus(vector<NoiseModuleThreadStatusData> &status)
{
	UINT i;
	unsigned int num_connections=0;
	for(i=0;i<status.size();i++)
	{
		m_num_good_connections+=status[i].m_num_good_connections;
		m_num_bogus_connections+=status[i].m_num_bogus_connections;
	}

	// Tell the list
//	if(m_list.IsWindowEnabled())
//	{
		m_list.ReportStatus(status);
//	}

	// Counters
	char buf[4096];
	sprintf(buf,"Mods : %u   /   Connections : %s",p_parent->GetModCount(),FormatWithCommas(m_list.GetItemCount()).c_str());
	GetDlgItem(IDC_Num_Current_Connections)->SetWindowText(buf);

	sprintf(buf,"Good Connections : %s",FormatWithCommas(m_num_good_connections).c_str());
	GetDlgItem(IDC_Num_Good_Connections)->SetWindowText(buf);

	sprintf(buf,"Bogus Connections : %s",FormatWithCommas(m_num_bogus_connections).c_str());
	GetDlgItem(IDC_Num_Bogus_Connections)->SetWindowText(buf);

	sprintf(buf,"Total Connections : %s",FormatWithCommas(m_total_num_received_connections).c_str());
	GetDlgItem(IDC_Total_Num_Connections)->SetWindowText(buf);

	// Update the virtual list control if it is enabled
	if(m_list.IsWindowEnabled())
	{
		m_list.SetItemCountEx(m_list.GetItemCount(),LVSICF_NOSCROLL);
	}

	// Write out logfile
	//WriteToLogfile();
}