Exemplo n.º 1
0
/*
wxFileName FileMcd_GetSimpleName(uint slot)
{
	if( FileMcd_IsMultitapSlot(slot) )
		return g_Conf->Folders.MemoryCards + wxsFormat( L"Mcd-Multitap%u-Slot%02u.ps2", FileMcd_GetMtapPort(slot)+1, FileMcd_GetMtapSlot(slot)+1 );
	else
		return g_Conf->Folders.MemoryCards + wxsFormat( L"Mcd%03u.ps2", slot+1 );
}
*/
wxString FileMcd_GetDefaultName(uint slot)
{
	if( FileMcd_IsMultitapSlot(slot) )
		return wxsFormat( L"Mcd-Multitap%u-Slot%02u.ps2", FileMcd_GetMtapPort(slot)+1, FileMcd_GetMtapSlot(slot)+1 );
	else
		return wxsFormat( L"Mcd%03u.ps2", slot+1 );
}
Exemplo n.º 2
0
Exception::RuntimeError::RuntimeError( const std::exception& ex, const wxString& prefix )
{
	IsSilent = false;

	const wxString msg( wxsFormat( L"STL Exception%s: %s",
		(prefix.IsEmpty() ? prefix.c_str() : wxsFormat(L" (%s)", prefix.c_str()).c_str()),
		fromUTF8( ex.what() ).c_str()
	) );

	SetDiagMsg( msg );
}
Exemplo n.º 3
0
wxString Exception::WinApiError::GetMsgFromWindows() const
{
    if (!ErrorId) return L"No valid error number was assigned to this exception!";

    const DWORD BUF_LEN = 2048;
    TCHAR t_Msg[BUF_LEN];
    if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, ErrorId, 0, t_Msg, BUF_LEN, 0))
        return wxsFormat( L"Win32 Error #%d: %s", ErrorId, t_Msg );

    return wxsFormat( L"Win32 Error #%d (no text msg available)", ErrorId );
}
Exemplo n.º 4
0
wxString Exception::Stream::FormatDiagnosticMessage() const
{
	return wxsFormat(
		L"%s\n\tFile/Object: %s",
		m_message_diag.c_str(), StreamName.c_str()
	);
}
Exemplo n.º 5
0
	void MemProtect( void* baseaddr, size_t size, PageProtectionMode mode, bool allowExecution )
	{
		pxAssertDev( ((size & (__pagesize-1)) == 0), wxsFormat(
			L"Memory block size must be a multiple of the target platform's page size.\n"
			L"\tPage Size: 0x%04x (%d), Block Size: 0x%04x (%d)",
			__pagesize, __pagesize, size, size )
		);

		DWORD winmode = 0;

		switch( mode )
		{
			case Protect_NoAccess:
				winmode = ( allowExecution ) ? PAGE_EXECUTE : PAGE_NOACCESS;
			break;

			case Protect_ReadOnly:
				winmode = ( allowExecution ) ? PAGE_EXECUTE_READ : PAGE_READONLY;
			break;

			case Protect_ReadWrite:
				winmode = ( allowExecution ) ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE;
			break;
		}

		DWORD OldProtect;	// enjoy my uselessness, yo!
		VirtualProtect( baseaddr, size, winmode, &OldProtect );
	}
Exemplo n.º 6
0
void PerPluginMenuInfo::Populate( PluginsEnum_t pid )
{
	if( !pxAssert(pid < PluginId_Count) ) return;

	PluginId = pid;

	MyMenu.Append( GetPluginMenuId_Name(PluginId), _("No plugin loaded") )->Enable( false );
	MyMenu.AppendSeparator();

	if( PluginId == PluginId_GS )
	{
		MyMenu.Append( MenuId_Video_CoreSettings, _("Core GS Settings..."),
			_("Modify hardware emulation settings regulated by the PCSX2 core virtual machine.") );

		MyMenu.Append( MenuId_Video_WindowSettings, _("Window Settings..."),
			_("Modify window and appearance options, including aspect ratio.") );

		MyMenu.AppendSeparator();
	}

	// Populate options from the plugin here.

	MyMenu.Append( GetPluginMenuId_Settings(PluginId), _("Plugin Settings..."),
		wxsFormat( _("Opens the %s plugin's advanced settings dialog."), tbl_PluginInfo[pid].GetShortname().c_str() )
	);
}
Exemplo n.º 7
0
static void mVUresizeCache(mV, u32 size) {

	if (size >= (u32)mVUcacheMaxSize) {
		if (mVU->cacheSize==mVUcacheMaxSize) {
			// We can't grow the rec any larger, so just reset it and start over.
			//(if we don't reset, the rec will eventually crash)
			Console.WriteLn(Color_Magenta, "microVU%d: Cannot grow cache, size limit reached! [%dmb].  Resetting rec.", mVU->index, mVU->cacheSize/_1mb);
			mVU->reset();
			return;
		}
		size = mVUcacheMaxSize;
	}

	if (mVU->cache) Console.WriteLn(Color_Green, "microVU%d: Attempting to resize Cache [%dmb]", mVU->index, size/_1mb);

	u8* cache = SysMmapEx(0, size, 0, (mVU->index ? "Micro VU1 RecCache" : "Micro VU0 RecCache"));
	if(!cache && !mVU->cache) throw Exception::OutOfMemory( wxsFormat( L"Micro VU%d recompiled code cache", mVU->index) );
	if(!cache) { Console.Error("microVU%d Error - Cache Resize Failed...", mVU->index); mVU->reset(); return; }
	if (mVU->cache) {
		HostSys::Munmap(mVU->cache, mVU->cacheSize);
		ProfilerTerminateSource(isVU1?"mVU1 Rec":"mVU0 Rec");
	}

	mVU->cache	   = cache;
	mVU->cacheSize = size;
	ProfilerRegisterSource(isVU1?"mVU1 Rec":"mVU0 Rec", mVU->cache, mVU->cacheSize);
	mVU->reset();
}
Exemplo n.º 8
0
wxString Exception::Stream::FormatDisplayMessage() const
{
	wxString retval( m_message_user );
	if (!StreamName.IsEmpty())
		retval += L"\n\n" + wxsFormat( _("Path: %s"), StreamName.c_str() );

	return retval;
}
Exemplo n.º 9
0
	void patchHelper(const wxString& cmd, const wxString& param) {
		// Error Handling Note:  I just throw simple wxStrings here, and then catch them below and
		// format them into more detailed cmd+data+error printouts.  If we want to add user-friendly
		// (translated) messages for display in a popup window then we'll have to upgrade the
		// exception a little bit.

		// print the actual patch lines only in verbose mode (even in devel)
		if (DevConWriterEnabled)
			DevCon.WriteLn(cmd + L" " + param);

		try
		{
			if (isCheat && cheatnumber >= MAX_CHEAT)
				throw wxString( L"Maximum number of cheats reached" );
			if(!isCheat && patchnumber >= MAX_PATCH)
				throw wxString( L"Maximum number of patches reached" );

			IniPatch& iPatch = isCheat ? Cheat[cheatnumber] : Patch[patchnumber];
			PatchPieces pieces(param);

			iPatch.enabled = 0;

			iPatch.placetopatch	= StrToU32(pieces.PlaceToPatch(), 10);
			iPatch.cpu			= (patch_cpu_type)PatchTableExecute(pieces.CpuType(), cpuCore);
			iPatch.addr			= StrToU32(pieces.MemAddr(), 16);
			iPatch.type			= (patch_data_type)PatchTableExecute(pieces.OperandSize(), dataType);
			iPatch.data			= StrToU64(pieces.WriteValue(), 16);

			if (iPatch.cpu  == 0)
				throw wxsFormat(L"Unrecognized CPU Target: '%s'", WX_STR(pieces.CpuType()));

			if (iPatch.type == 0)
				throw wxsFormat(L"Unrecognized Operand Size: '%s'", WX_STR(pieces.OperandSize()));

			iPatch.enabled = 1; // omg success!!

			if (isCheat) cheatnumber++;
			else		 patchnumber++;
		}
		catch( wxString& exmsg )
		{
			Console.Error(L"(Patch) Error Parsing: %s=%s", WX_STR(cmd), WX_STR(param));
			Console.Indent().Error( exmsg );
		}
	}
Exemplo n.º 10
0
wxString IsoDirectory::FStype_ToString() const
{
	switch( m_fstype )
	{
		case FStype_ISO9660:	return L"ISO9660";		break;
		case FStype_Joliet:		return L"Joliet";		break;
	}

	return wxsFormat( L"Unrecognized Code (0x%x)", m_fstype );
}
Exemplo n.º 11
0
// I'd keep an eye on this function, as it may still be problematic.
void Sstates_updateLoadBackupMenuItem(bool isBeforeSave)
{
	wxString file = SaveStateBase::GetFilename(StatesC);

	if (!(isBeforeSave && g_Conf->EmuOptions.BackupSavestate))
	{
		file = file + L".backup";
	}

	sMainFrame.EnableMenuItem(MenuId_State_LoadBackup, wxFileExists(file));
	sMainFrame.SetMenuItemLabel(MenuId_State_LoadBackup, wxsFormat(L"%s %d", _("Backup"), StatesC));
}
Exemplo n.º 12
0
void CtrlRegisterList::changeValue(RegisterChangeMode mode, int cat, int reg)
{
    wxString oldStr;
    u128 oldValue = cpu->getRegister(cat, reg);

    switch (mode)
    {
    case LOWER64:
        oldStr = wxsFormat(L"0x%016llX", oldValue._u64[0]);
        break;
    case UPPER64:
        oldStr = wxsFormat(L"0x%016llX", oldValue._u64[1]);
        break;
    case CHANGE32:
        oldStr = wxsFormat(L"0x%08X", oldValue._u64[0]);
        break;
    }

    u64 newValue;
    if (executeExpressionWindow(this, cpu, newValue, oldStr))
    {
        switch (mode)
        {
        case LOWER64:
            oldValue._u64[0] = newValue;
            break;
        case UPPER64:
            oldValue._u64[1] = newValue;
            break;
        case CHANGE32:
            oldValue._u32[0] = newValue;
            break;
        }
        cpu->setRegister(cat, reg, oldValue);
        oldValue = cpu->getRegister(cat, reg);
    }
    needsValueUpdating = true;
    needsSizeUpdating = true;
}
Exemplo n.º 13
0
// Called when this window needs to update the strings in the cells.
// This has to be called every repaint of the window since the registers
// can change unpredictably and there seems to be currently is no mechanism
// for the rest of pcsx2 alerting the debugger when values change.
void CtrlRegisterList::updateValues(int cat)
{
    wxGrid* regGrid = registerGrids[cat];
    int numRows = regGrid->GetNumberRows();
    int numCols = regGrid->GetNumberCols();

    std::vector<ChangedReg>& changedRegs = changedCategories[cat];
    DebugInterface::RegisterType type = cpu->getRegisterType(cat);
    for (int row = 0; row < numRows; row++)
    {
        wxColor bgColor = regGrid->GetGridCursorRow() == row ? wxColor(0xFFFFDFE0) :
                                                               wxColor(0xFFFFEFFF);
        u128 value = cpu->getRegister(cat, row);
        ChangedReg& changed = changedRegs[row];

        for (int col = 0; col < numCols; col++)
        {
            const wxColor colorChanged = wxColor(0xFF0000FF);
            const wxColor colorUnchanged = wxColor(0xFF004000);
            wxColor textColor;
            wxString cellValue;

            switch (type)
            {
            case DebugInterface::NORMAL:
                cellValue = wxsFormat(L"%08X", value._u32[numCols - col - 1]);
                textColor = changed.changed[numCols - col - 1] ? colorChanged : colorUnchanged;
                break;
            case DebugInterface::SPECIAL:
                cellValue = cpu->getRegisterString(cat, row);
                textColor = (changed.changed[0] || changed.changed[1] || changed.changed[2] || changed.changed[3]) ?
                    colorChanged : colorUnchanged;
                break;
            default: pxAssert(0 && "Unreachable switch case");
            }
            if (regGrid->GetCellTextColour(row, col) != textColor)
                regGrid->SetCellTextColour(row, col, textColor);
            if (regGrid->GetCellValue(row, col) != cellValue)
                regGrid->SetCellValue(row, col, cellValue);
            if (regGrid->GetCellBackgroundColour(row, col) != bgColor)
                regGrid->SetCellBackgroundColour(row, col, bgColor);
        }
    }
}
Exemplo n.º 14
0
bool AppConfig::isOkGetPresetTextAndColor( int n, wxString& label, wxColor& c )
{
	const wxString presetNamesAndColors[][2] =
	{
		{ _t("Safest"),				L"Forest GREEN" },
		{ _t("Safe (faster)"),		L"Dark Green" },
		{ _t("Balanced"),			L"Blue" },
		{ _t("Aggressive"),			L"Purple" },
		{ _t("Aggressive plus"),	L"Orange"},
		{ _t("Mostly Harmful"),		L"Red" }
	};
	if( n<0 || n>GetMaxPresetIndex() )
		return false;

	label = wxsFormat(L"%d - ", n+1) + presetNamesAndColors[n][0];
	c	  = wxColor(presetNamesAndColors[n][1]);

    return true;
}
Exemplo n.º 15
0
// ------------------------------------------------------------------------
wxMenu* MainEmuFrame::MakeStatesSubMenu( int baseid, int loadBackupId ) const
{
	wxMenu* mnuSubstates = new wxMenu();

	for (int i = 0; i < 10; i++)
	{
		mnuSubstates->Append( baseid+i+1, wxsFormat(_("Slot %d"), i) );
	}
	if( loadBackupId>=0 )
	{
		mnuSubstates->AppendSeparator();

		wxMenuItem* m = mnuSubstates->Append( loadBackupId,	_("Backup") );
		m->Enable( false );
		States_registerLoadBackupMenuItem( m );
	}

	//mnuSubstates->Append( baseid - 1,	_("Other...") );
	return mnuSubstates;
}
Exemplo n.º 16
0
static __fi void mVUthrowHardwareDeficiency(const wxChar* extFail, int vuIndex) {
	throw Exception::HardwareDeficiency()
		.SetDiagMsg(wxsFormat(L"microVU%d recompiler init failed: %s is not available.", vuIndex, extFail))
		.SetUserMsg(wxsFormat(_("%s Extensions not found.  microVU requires a host CPU with MMX, SSE, and SSE2 extensions."), extFail ));
}
Exemplo n.º 17
0
CtrlRegisterList::CtrlRegisterList(wxWindow* parent, DebugInterface* _cpu) :
    wxWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS | wxBORDER_NONE),
    cpu(_cpu),
    lastPc(0),
    lastCycles(0),
    maxBits(128),
    needsSizeUpdating(true),
    needsValueUpdating(true)
{
    int rowHeight = g_Conf->EmuOptions.Debugger.FontHeight;
    int charWidth = g_Conf->EmuOptions.Debugger.FontWidth;


#ifdef _WIN32
    wxFont font = wxFont(wxSize(charWidth, rowHeight), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL,
        false, L"Lucida Console");
    wxFont labelFont = font.Bold();
#else
    wxFont font = wxFont(8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, L"Lucida Console");
    font.SetPixelSize(wxSize(charWidth, rowHeight));
    wxFont labelFont = font;
    labelFont.SetWeight(wxFONTWEIGHT_BOLD);
#endif
    registerCategories = new wxNotebook(this, wxID_ANY);
// 'c' and 'C', much time wasted.
#if wxMAJOR_VERSION >= 3
    registerCategories->Connect(wxEVT_BOOKCTRL_PAGE_CHANGED, wxBookCtrlEventHandler(CtrlRegisterList::categoryChangedEvent), nullptr, this);
#else
    registerCategories->Connect(wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED, wxBookctrlEventHandler(CtrlRegisterList::categoryChangedEvent), nullptr, this);
#endif
    for (int cat = 0; cat < cpu->getRegisterCategoryCount(); cat++)
    {
        int numRegs = cpu->getRegisterCount(cat);

        changedCategories.push_back(std::vector<ChangedReg>(numRegs));

        wxGrid* regGrid = new wxGrid(registerCategories, -1);

        registerGrids.push_back(regGrid);
        registerCategories->AddPage(regGrid, wxString(cpu->getRegisterCategoryName(cat), wxConvUTF8));

        DebugInterface::RegisterType type = cpu->getRegisterType(cat);
        int registerBits = cpu->getRegisterSize(cat);

        int numCols;
        switch (type)
        {
        case DebugInterface::NORMAL:	// display them in 32 bit parts
            numCols = registerBits / 32;
            regGrid->CreateGrid(numRegs, numCols);
            for (int row = 0; row < numRegs; row++)
                regGrid->SetRowLabelValue(row, wxString(cpu->getRegisterName(cat, row), wxConvUTF8));
            for (int col = 0; col < numCols; col++)
                regGrid->SetColLabelValue(col, wxsFormat(L"%d-%d", 32 * (numCols - col) - 1, 32 * (numCols - col - 1)));
            break;
        case DebugInterface::SPECIAL:
            regGrid->CreateGrid(numRegs, 1);
            for (int row = 0; row < numRegs; row++)
                regGrid->SetRowLabelValue(row, wxString(cpu->getRegisterName(cat, row), wxConvUTF8));
            break;
        }

        regGrid->EnableEditing(false);
        regGrid->SetDefaultCellFont(font);
        regGrid->SetLabelFont(labelFont);
        regGrid->DisableDragGridSize();
        regGrid->DisableDragRowSize();
        regGrid->DisableDragColSize();
        regGrid->Connect(wxEVT_PAINT, wxPaintEventHandler(CtrlRegisterList::paintEvent), nullptr, this);
        regGrid->Connect(wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler(CtrlRegisterList::gridEvent), nullptr, this);
        regGrid->Connect(wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler(CtrlRegisterList::gridEvent), nullptr, this);
        regGrid->Connect(wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler(CtrlRegisterList::gridEvent), nullptr, this);
        regGrid->Connect(wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler(CtrlRegisterList::gridEvent), nullptr, this);
        regGrid->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(CtrlRegisterList::keydownEvent), nullptr, this);
    }

    for (int cat = 0; cat < cpu->getRegisterCategoryCount(); cat++)
        updateValues(cat);

    updateSize(getCurrentCategory()); // getCurrentCategory() = 0

    SetDoubleBuffered(true);
}
Exemplo n.º 18
0
wxString Exception::OutOfMemory::FormatDiagnosticMessage() const
{
	return wxsFormat(m_message_diag, AllocDescription.c_str());
}
Exemplo n.º 19
0
	wxString GetDisabledMessage( uint slot ) const
	{
		return wxsFormat( pxE( L"The PS2-slot %d has been automatically disabled.  You can correct the problem\nand re-enable it at any time using Config:Memory cards from the main menu."
					) , slot//TODO: translate internal slot index to human-readable slot description
		);
	}
Exemplo n.º 20
0
void FileMemoryCard::Open()
{
	for( int slot=0; slot<8; ++slot )
	{
		if( FileMcd_IsMultitapSlot(slot) )
		{
			if( !EmuConfig.MultitapPort0_Enabled && (FileMcd_GetMtapPort(slot) == 0) ) continue;
			if( !EmuConfig.MultitapPort1_Enabled && (FileMcd_GetMtapPort(slot) == 1) ) continue;
		}

		wxFileName fname( g_Conf->FullpathToMcd( slot ) );
		wxString str( fname.GetFullPath() );
		bool cont = false;

		if( fname.GetFullName().IsEmpty() )
		{
			str = L"[empty filename]";
			cont = true;
		}

		if( !g_Conf->Mcd[slot].Enabled )
		{
			str = L"[disabled]";
			cont = true;
		}

		if ( g_Conf->Mcd[slot].Type != MemoryCardType::MemoryCard_File ) {
			str = L"[is not memcard file]";
			cont = true;
		}

		Console.WriteLn( cont ? Color_Gray : Color_Green, L"McdSlot %u [File]: " + str, slot );
		if( cont ) continue;

		const wxULongLong fsz = fname.GetSize();
		if( (fsz == 0) || (fsz == wxInvalidSize) )
		{
			// FIXME : Ideally this should prompt the user for the size of the
			// memory card file they would like to create, instead of trying to
			// create one automatically.
		
			if( !Create( str, 8 ) )
			{
				Msgbox::Alert(
					wxsFormat(_( "Could not create a memory card: \n\n%s\n\n" ), str.c_str()) +
					GetDisabledMessage( slot )
				);
			}
		}

		// [TODO] : Add memcard size detection and report it to the console log.
		//   (8MB, 256Mb, formatted, unformatted, etc ...)

#ifdef __WXMSW__
		NTFS_CompressFile( str, g_Conf->McdCompressNTFS );
#endif

		if( !m_file[slot].Open( str.c_str(), L"r+b" ) )
		{
			// Translation note: detailed description should mention that the memory card will be disabled
			// for the duration of this session.
			Msgbox::Alert(
				wxsFormat(_( "Access denied to memory card: \n\n%s\n\n" ), str.c_str()) +
				GetDisabledMessage( slot )
			);
		}
		else // Load checksum
		{
			m_ispsx[slot] = m_file[slot].Length() == 0x20000;
			m_chkaddr = 0x210;

			if(!m_ispsx[slot] && !!m_file[slot].Seek( m_chkaddr ))
				m_file[slot].Read( &m_chksum[slot], 8 );
		}
	}
}
Exemplo n.º 21
0
// Calculates the Windows OS Version and install information, and returns it as a
// human-readable string. :)
// (Handy function borrowed from Microsoft's MSDN Online, and reformatted to use wxString.)
wxString GetOSVersionString()
{
    wxString retval;

    OSVERSIONINFOEX	osvi;
    SYSTEM_INFO		si;
    PGNSI			pGNSI;
    PGPI			pGPI;
    BOOL			bOsVersionInfoEx;
    DWORD			dwType;

    memzero( si );
    memzero( osvi );

    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);

    if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
        return L"GetVersionEx Error!";

    // Call GetNativeSystemInfo if supported or GetSystemInfo otherwise.

    pGNSI = (PGNSI) GetProcAddress( GetModuleHandle(L"kernel32.dll"), "GetNativeSystemInfo" );
    if(NULL != pGNSI)
        pGNSI( &si );
    else
        GetSystemInfo( &si );

    if ( VER_PLATFORM_WIN32_NT!=osvi.dwPlatformId || osvi.dwMajorVersion <= 4 )
        return L"Unsupported Operating System!";

    retval += L"Microsoft ";

    // Test for the specific product.

    if ( osvi.dwMajorVersion == 6 )
    {
        if( osvi.dwMinorVersion == 0 )
            retval += ( osvi.wProductType == VER_NT_WORKSTATION ) ? L"Windows Vista " : L"Windows Server 2008 ";

        if ( osvi.dwMinorVersion == 1 )
            retval += ( osvi.wProductType == VER_NT_WORKSTATION ) ? L"Windows 7 " : L"Windows Server 2008 R2 ";

        pGPI = (PGPI) GetProcAddress( GetModuleHandle(TEXT("kernel32.dll")), "GetProductInfo");

        pGPI( osvi.dwMajorVersion, osvi.dwMinorVersion, 0, 0, &dwType);

        switch( dwType )
        {
        case PRODUCT_ULTIMATE:
            retval += L"Ultimate Edition";
            break;
        case PRODUCT_HOME_PREMIUM:
            retval += L"Home Premium Edition";
            break;
        case PRODUCT_HOME_BASIC:
            retval += L"Home Basic Edition";
            break;
        case PRODUCT_ENTERPRISE:
            retval += L"Enterprise Edition";
            break;
        case PRODUCT_BUSINESS:
            retval += L"Business Edition";
            break;
        case PRODUCT_STARTER:
            retval += L"Starter Edition";
            break;
        case PRODUCT_CLUSTER_SERVER:
            retval += L"Cluster Server Edition";
            break;
        case PRODUCT_DATACENTER_SERVER:
            retval += L"Datacenter Edition";
            break;
        case PRODUCT_DATACENTER_SERVER_CORE:
            retval += L"Datacenter Edition (core installation)";
            break;
        case PRODUCT_ENTERPRISE_SERVER:
            retval += L"Enterprise Edition";
            break;
        case PRODUCT_ENTERPRISE_SERVER_CORE:
            retval += L"Enterprise Edition (core installation)";
            break;
        case PRODUCT_SMALLBUSINESS_SERVER:
            retval += L"Small Business Server";
            break;
        case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM:
            retval += L"Small Business Server Premium Edition";
            break;
        case PRODUCT_STANDARD_SERVER:
            retval += L"Standard Edition";
            break;
        case PRODUCT_STANDARD_SERVER_CORE:
            retval += L"Standard Edition (core installation)";
            break;
        case PRODUCT_WEB_SERVER:
            retval += L"Web Server Edition";
            break;
        }
    }

    if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
    {
        if( GetSystemMetrics(SM_SERVERR2) )
            retval += L"Windows Server 2003 R2, ";
        else if ( osvi.wSuiteMask==VER_SUITE_STORAGE_SERVER )
            retval += L"Windows Storage Server 2003";
        else if ( osvi.wSuiteMask==VER_SUITE_WH_SERVER )
            retval += L"Windows Home Server";
        else if( osvi.wProductType == VER_NT_WORKSTATION && si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64)
            retval += L"Windows XP Professional x64 Edition";
        else
            retval += L"Windows Server 2003, ";

        // Test for the server type.
        if ( osvi.wProductType != VER_NT_WORKSTATION )
        {
            if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 )
            {
                if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
                    retval += L"Datacenter x64 Edition";
                else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
                    retval += L"Enterprise x64 Edition";
                else
                    retval += L"Standard x64 Edition";
            }

            else
            {
                if ( osvi.wSuiteMask & VER_SUITE_COMPUTE_SERVER )
                    retval += L"Compute Cluster Edition";
                else if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
                    retval += L"Datacenter Edition";
                else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
                    retval += L"Enterprise Edition";
                else if ( osvi.wSuiteMask & VER_SUITE_BLADE )
                    retval += L"Web Edition";
                else
                    retval += L"Standard Edition";
            }
        }
    }

    if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )
    {
        retval += L"Windows XP ";
        retval += ( osvi.wSuiteMask & VER_SUITE_PERSONAL ) ? L"Professional" : L"Home Edition";
    }

    if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 )
    {
        retval += L"Windows 2000 ";

        if ( osvi.wProductType == VER_NT_WORKSTATION )
        {
            retval += L"Professional";
        }
        else
        {
            if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
                retval += L"Datacenter Server";
            else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
                retval += L"Advanced Server";
            else
                retval += L"Server";
        }
    }

    // Include service pack (if any) and build number.

    if( _tcslen(osvi.szCSDVersion) > 0 )
        retval += (wxString)L" " + osvi.szCSDVersion;

    retval += wxsFormat( L" (build %d)", osvi.dwBuildNumber );

    if ( osvi.dwMajorVersion >= 6 )
    {
        if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 )
            retval += L", 64-bit";
        else if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_INTEL )
            retval += L", 32-bit";
    }

    return retval;
}
Exemplo n.º 22
0
wxString DMACh::cmqt_to_str() const
{
	return wxsFormat(L"chcr = %lx, madr = %lx, qwc  = %lx, tadr = %1x", chcr._u32, madr, qwc, tadr);
}
Exemplo n.º 23
0
wxString Exception::OutOfMemory::FormatDisplayMessage() const
{
	if (m_message_user.IsEmpty()) return FormatDisplayMessage();
	return m_message_user + wxsFormat( L"\n\nInternal allocation descriptor: %s", AllocDescription.c_str());
}
Exemplo n.º 24
0
void setIni(const wchar_t* Section)
 {
	initIni();
	spuConfig->SetPath(wxsFormat(L"/%s", Section));
 }
Exemplo n.º 25
0
		PatchPieces( const wxString& param )
		{
			SplitString( m_pieces, param, L"," );
			if( m_pieces.Count() < 5 )
				throw wxsFormat( L"Expected 5 data parameters; only found %d", m_pieces.Count() );
		}