MCPcopy Create free account
hub / github.com/bwapi/bwapi / getProcessCount

Function getProcessCount

bwapi/BWAPI/Source/Config.cpp:22–39  ·  view source on GitHub ↗

--------------------------------------------- GET PROC COUNT ----------------------------------------------- Found/modified this from some random help board

Source from the content-addressed store, hash-verified

20//--------------------------------------------- GET PROC COUNT -----------------------------------------------
21// Found/modified this from some random help board
22DWORD getProcessCount(const char *pszProcName)
23{
24 PROCESSENTRY32 pe32;
25 pe32.dwSize = sizeof(PROCESSENTRY32);
26
27 DWORD dwCount = 0;
28 HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
29 if ( Process32First(hSnapshot, &pe32) )
30 {
31 do
32 {
33 if( _strcmpi(pe32.szExeFile, pszProcName) == 0 )
34 ++dwCount;
35 } while( Process32Next(hSnapshot, &pe32) );
36 }
37 CloseHandle(hSnapshot);
38 return dwCount;
39}
40
41//----------------------------- LOAD CONFIG FXNS ------------------------------------------
42std::string envKeyName(const char *pszKey, const char *pszItem)

Callers 1

InitPrimaryConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected