MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / GetApplicationInstance

Method GetApplicationInstance

Code/CryEngine/CrySystem/SystemWin32.cpp:584–608  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

582
583//////////////////////////////////////////////////////////////////////////
584int CSystem::GetApplicationInstance()
585{
586#if CRY_PLATFORM_WINDOWS
587 if (m_iApplicationInstance == -1)
588 {
589 string suffix;
590 for (int instance = 0;; ++instance)
591 {
592 suffix.Format("(%d)", instance);
593
594 HANDLE instanceMutex = CreateMutex(NULL, TRUE, "CrytekApplication" + suffix);
595 // search for duplicates
596 if (GetLastError() != ERROR_ALREADY_EXISTS)
597 {
598 m_iApplicationInstance = instance;
599 break;
600 }
601 }
602 }
603
604 return m_iApplicationInstance;
605#else
606 return 0;
607#endif
608}
609
610// refreshes the m_pMemStats if necessary; creates it if it's not created
611//////////////////////////////////////////////////////////////////////////

Callers 12

WriteMMMDataCacheFunction · 0.80
WriteMMMDataFunction · 0.80
ReadMMMDataCacheFunction · 0.80
MMMDebugInitFunction · 0.80
TickMethod · 0.80
GetUniqueLogFileNameFunction · 0.80
UpdateClientNameMethod · 0.80
ConfigurationCallbackMethod · 0.80
Debug_GetEmailMethod · 0.80
Debug_GetPasswordMethod · 0.80
Debug_GetPersonaMethod · 0.80

Calls 2

GetLastErrorFunction · 0.85
FormatMethod · 0.80

Tested by

no test coverage detected