1 // Windows/System.h 2 3 #ifndef __WINDOWS_SYSTEM_H 4 #define __WINDOWS_SYSTEM_H 5 6 #include "../Common/MyTypes.h" 7 8 namespace NWindows { 9 namespace NSystem { 10 11 UInt32 CountAffinity(DWORD_PTR mask); 12 13 struct CProcessAffinity 14 { 15 // UInt32 numProcessThreads; 16 // UInt32 numSysThreads; 17 DWORD_PTR processAffinityMask; 18 DWORD_PTR systemAffinityMask; 19 InitSTCProcessAffinity20 void InitST() 21 { 22 // numProcessThreads = 1; 23 // numSysThreads = 1; 24 processAffinityMask = 1; 25 systemAffinityMask = 1; 26 } 27 GetNumProcessThreadsCProcessAffinity28 UInt32 GetNumProcessThreads() const { return CountAffinity(processAffinityMask); } GetNumSystemThreadsCProcessAffinity29 UInt32 GetNumSystemThreads() const { return CountAffinity(systemAffinityMask); } 30 31 BOOL Get(); 32 }; 33 34 UInt32 GetNumberOfProcessors(); 35 36 bool GetRamSize(UInt64 &size); // returns false, if unknown ram size 37 38 }} 39 40 #endif 41