AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
infoimpl.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
9 #include "ajabase/system/info.h"
11 
12 // need to link with Shlwapi.lib & Netapi32.lib
13 #pragma warning(disable:4996)
14 #include <intrin.h>
15 #include <io.h>
16 #include <Knownfolders.h>
17 #include <LM.h>
18 #include <ShlObj.h>
19 #include <Shlwapi.h>
20 #include <time.h>
21 #include <iomanip>
22 #include <comdef.h>
23 #include <Wbemidl.h> // links with wbemuuid.lib
24 #include <sstream>
25 
27 {
28  int major;
29  int minor;
31  char* serverName;
32 };
33 
35 {
36  { 5, 0, (char*)"Windows 2000", (char*)"Windows 2000"},
37  { 5, 1, (char*)"Windows XP", (char*)"Windows XP"},
38  { 5, 2, (char*)"Windows Server 2003", (char*)"Windows Server 2003"}, // This one is special cased in code
39  { 6, 0, (char*)"Windows Vista", (char*)"Windows Server 2008"},
40  { 6, 1, (char*)"Windows 7", (char*)"Windows Server 2008 R2"},
41  { 6, 2, (char*)"Windows 8", (char*)"Windows Server 2012"},
42  { 6, 3, (char*)"Windows 8.1", (char*)"Windows Server 2012 R2"}
43  //{10, 0, (char*)"Windows 10", (char*)"Windows Server 2016"} // Use Registry to retrieve from this point forward
44 };
46 
47 std::string
49 {
50  std::string outVal;
51  std::string key_path = "HARDWARE\\DESCRIPTION\\System\\BIOS";
52 
53  outVal = aja::read_registry_string(HKEY_LOCAL_MACHINE, key_path, "SystemManufacturer");
54  if (outVal.empty() == false)
55  outVal += " ";
56  outVal += aja::read_registry_string(HKEY_LOCAL_MACHINE, key_path, "SystemProductName");
57  if (outVal.empty() == false)
58  outVal += " (";
59  outVal += aja::read_registry_string(HKEY_LOCAL_MACHINE, key_path, "SystemFamily");
60  if (outVal.empty() == false)
61  outVal += ")";
62 
63  return outVal;
64 }
65 
66 std::string
68 {
69  std::string outVal;
70  std::string key_path = "HARDWARE\\DESCRIPTION\\System\\BIOS";
71  outVal = aja::read_registry_string(HKEY_LOCAL_MACHINE, key_path, "BIOSVendor");
72  if (outVal.empty() == false)
73  outVal += " ";
74  outVal += aja::read_registry_string(HKEY_LOCAL_MACHINE, key_path, "BIOSVersion");
75  if (outVal.empty() == false)
76  outVal += ", ";
77  outVal += aja::read_registry_string(HKEY_LOCAL_MACHINE, key_path, "BIOSReleaseDate");
78 
79  return outVal;
80 }
81 
82 std::string
84 {
85  std::string outVal;
86  TCHAR buffer[256] = TEXT("");
87  DWORD dwSize = MAX_COMPUTERNAME_LENGTH*2;
88  if (GetComputerNameEx(ComputerNameDnsHostname, buffer, &dwSize))
89  {
90  outVal = buffer;
91  }
92 
93  return outVal;
94 }
95 
96 std::string
98 {
99  ULARGE_INTEGER li;
100  li.QuadPart = GetTickCount64() * 10000;
101 
102  FILETIME sinceBoot;
103  sinceBoot.dwLowDateTime = li.LowPart;
104  sinceBoot.dwHighDateTime = li.HighPart;
105 
106  SYSTEMTIME stNow;
107  GetLocalTime(&stNow);
108  FILETIME nowTime;
109 
110  SystemTimeToFileTime(&stNow, &nowTime);
111  FILETIME bootTime;
112 
113  // Need to combine the high and low parts before doing the time arithmetic
114  ULARGE_INTEGER nowLi, sinceBootLi, bootTimeLi;
115  nowLi.HighPart = nowTime.dwHighDateTime;
116  nowLi.LowPart = nowTime.dwLowDateTime;
117  sinceBootLi.HighPart = sinceBoot.dwHighDateTime;
118  sinceBootLi.LowPart = sinceBoot.dwLowDateTime;
119 
120  bootTimeLi.QuadPart = nowLi.QuadPart - sinceBootLi.QuadPart;
121 
122  bootTime.dwHighDateTime = bootTimeLi.HighPart;
123  bootTime.dwLowDateTime = bootTimeLi.LowPart;
124 
125  SYSTEMTIME sysBootTime;
126  FileTimeToSystemTime(&bootTime, &sysBootTime);
127 
128  std::ostringstream t;
129  t << std::setfill('0') << std::setw(4) << sysBootTime.wYear << "-" <<
130  std::setfill('0') << std::setw(2) << sysBootTime.wMonth << "-" <<
131  std::setfill('0') << std::setw(2) << sysBootTime.wDay << " " <<
132  std::setfill('0') << std::setw(2) << sysBootTime.wHour << ":" <<
133  std::setfill('0') << std::setw(2) << sysBootTime.wMinute << ":" <<
134  std::setfill('0') << std::setw(2) << sysBootTime.wSecond;
135 
136  return t.str();
137 }
138 
139 // Uses WMI (Windows Management Instrumentation), to retrieve a pretty OS name complete with edition.
140 // WMI Object=Win32_OperatingSystem ; Property=Caption
141 // The Method used below was largely taken from an MSDN example. This method was chosen for it's use of native Win32 API
142 // The same property can be retrieved with a single line powershell command: (Get-WmiObject Win32_OperatingSystem).Caption
143 static std::string getOSName_WMI()
144 {
145  std::string retVal = "Microsoft Windows";
146 
147  // Initialize COM
148  HRESULT hres = CoInitializeEx(0, COINIT_APARTMENTTHREADED);
149  if (!SUCCEEDED(hres) && hres != RPC_E_CHANGED_MODE) {
150  // Bail out...CoUninitialize should only be called if the call to CoInitialize was successful.
151  return retVal;
152  }
153 
154  // Obtain the initial locator
155  IWbemLocator *pLoc = NULL;
156  hres = CoCreateInstance(
157  CLSID_WbemLocator,
158  0,
159  CLSCTX_INPROC_SERVER,
160  IID_IWbemLocator, (LPVOID *) &pLoc);
161  if (FAILED(hres)){
162  goto cleanup;
163  }
164 
165  // Connect to the root\cimv2 namespace with
166  // the current user and obtain pointer pSvc
167  // to make IWbemServices calls.
168  IWbemServices *pSvc = NULL;
169  hres = pLoc->ConnectServer(
170  _bstr_t(L"ROOT\\CIMV2"), // Object path of WMI namespace
171  NULL, // User name. NULL = current user
172  NULL, // User password. NULL = current
173  0, // Locale. NULL indicates current
174  NULL, // Security flags.
175  0, // Authority (for example, Kerberos)
176  0, // Context object
177  &pSvc // pointer to IWbemServices proxy
178  );
179  if (FAILED(hres)){
180  goto cleanup;
181  }
182 
183  IClientSecurity* pSecurity = NULL;
184  hres = pSvc->QueryInterface(IID_IClientSecurity, (LPVOID*)&pSecurity);
185  if (FAILED(hres) || !pSecurity) {
186  goto cleanup;
187  }
188 
189  // Querying the current authentication information
190  DWORD authnSvc = 0;
191  DWORD authzSvc = 0;
192  LPOLESTR serverPrincName = NULL;
193  DWORD authnLevel = 0;
194  DWORD impLevel = 0;
195  RPC_AUTH_IDENTITY_HANDLE authInfo = NULL;
196  DWORD ifCapabilites = 0;
197 
198  hres = pSecurity->QueryBlanket(pSvc,
199  &authnSvc,
200  &authzSvc,
201  &serverPrincName,
202  &authnLevel,
203  &impLevel,
204  &authInfo,
205  &ifCapabilites);
206  if (FAILED(hres)) {
207  goto cleanup;
208  }
209 
210  // Setting authentication information on proxy interface
211  hres = pSecurity->SetBlanket(pSvc,
212  authnSvc,
213  authzSvc,
214  serverPrincName,
215  RPC_C_AUTHN_LEVEL_DEFAULT,
216  RPC_C_IMP_LEVEL_IMPERSONATE,
217  authInfo,
218  EOAC_NONE);
219 
220  if (FAILED(hres)) {
221  goto cleanup;
222  }
223 
224  //Execute Query agianst WMI Object: Win32_OperatingSystem
225  IEnumWbemClassObject* pEnumerator = NULL;
226  hres = pSvc->ExecQuery(
227  bstr_t("WQL"),
228  bstr_t("SELECT Caption FROM Win32_OperatingSystem"),
229  WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
230  NULL,
231  &pEnumerator);
232  if (FAILED(hres)) {
233  goto cleanup;
234  }
235 
236  // Get the data from the query -------------------
237  IWbemClassObject *pClsObj = NULL;
238  ULONG uReturn = 0;
239  hres = pEnumerator->Next(WBEM_INFINITE, 1, &pClsObj, &uReturn);
240  if(FAILED(hres) || 0 == uReturn) {
241  goto cleanup;
242  }
243 
244  // Get the value of the Name property
245  VARIANT vtProp;
246  VariantInit(&vtProp);
247  hres = pClsObj->Get(L"Caption", 0, &vtProp, 0, 0);
248  if (SUCCEEDED(hres)) {
249  retVal = _bstr_t(vtProp.bstrVal);
250  }
251  VariantClear(&vtProp);
252 
253 cleanup:
254  if (pSvc != NULL) {
255  pSvc->Release();
256  pSvc = NULL;
257  }
258  if (pLoc != NULL) {
259  pLoc->Release();
260  pLoc = NULL;
261  }
262  if (pEnumerator != NULL) {
263  pEnumerator->Release();
264  pEnumerator = NULL;
265  }
266  if (pClsObj != NULL) {
267  pClsObj->Release();
268  pClsObj = NULL;
269  }
270 
271  CoUninitialize();
272 
273  return retVal;
274 }
275 
276 std::string
278 {
279  // get OS info
280  std::string osname = "Unknown";
281 
282  OSVERSIONINFOEX osInfo;
283  ZeroMemory(&osInfo, sizeof(OSVERSIONINFOEX));
284  osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
285  GetVersionEx((LPOSVERSIONINFO)&osInfo);
286 
287  int majorVersion = (int)osInfo.dwMajorVersion;
288  int minorVersion = (int)osInfo.dwMinorVersion;
289 
290  // Starting with Windows 8.1 the call to GetVersionEx() no longer returns
291  // the correct major and minor version numbers, instead it returns 6.2,
292  // which is Windows 8
293  //
294  // They forgot to "break" NetWkstaGetInfo(), so use that to get the
295  // major and minor versions for Windows 8.1 and beyound
296  //
297  // Update: Windows 10 and corresponding Server versions have been removed from WindowsVersionTable
298  // due to the variety of builds under Windows 10, while the majorVesrion and minorVersion apparently do not update beyond 10.0
299  // For Windows 10 and beyond, getting "Caption" from the WMI (Windows Management Instrumentation) Object Win32_OperatingSystem
300 
301  if (majorVersion >=6 && minorVersion >= 2)
302  {
303  LPBYTE pinfoRawData;
304  if (NERR_Success == NetWkstaGetInfo(NULL, 100, &pinfoRawData))
305  {
306  WKSTA_INFO_100 *pworkstationInfo = (WKSTA_INFO_100*)pinfoRawData;
307  majorVersion = (int)pworkstationInfo->wki100_ver_major;
308  minorVersion = (int)pworkstationInfo->wki100_ver_minor;
309  ::NetApiBufferFree(pinfoRawData);
310  }
311  }
312 
313  bool foundVersion = false;
314  for(int i=0;i<WindowsVersionTableSize;i++)
315  {
316  if (WindowsVersionTable[i].major == majorVersion &&
317  WindowsVersionTable[i].minor == minorVersion)
318  {
319  if (majorVersion == 5 && minorVersion == 2)
320  {
321  // This one is a strange beast, special case it
322  int ver2 = GetSystemMetrics(SM_SERVERR2);
323  SYSTEM_INFO sysInfo;
324  ZeroMemory(&sysInfo, sizeof(SYSTEM_INFO));
325  GetSystemInfo(&sysInfo);
326 
327  if (osInfo.wSuiteMask & VER_SUITE_WH_SERVER)
328  osname = "Windows Home Server";
329  else if(osInfo.wProductType == VER_NT_WORKSTATION &&
330  sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
331  osname = "Windows XP Professional x64 Edition";
332  else if(ver2 == 0)
333  osname = "Windows Server 2003";
334  else
335  osname = "Windows Server 2003 R2";
336  }
337  else
338  {
339  if (osInfo.wProductType == VER_NT_WORKSTATION)
341  else
342  osname = WindowsVersionTable[i].serverName;
343  }
344  foundVersion = true;
345  break;
346  }
347 
348  }
349 
350  if (!foundVersion)
351  {
352  //Microsoft is not updating the below key for Windows 11, it still reads as Windows 10.
353  //osname = aja::read_registry_string(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
354  // "ProductName");
355 
356  //Changed to retrieve a pretty OS Name with Edition from Win32_Operatingystem WMI class
357  osname = getOSName_WMI();
358  }
359 
360 
361 
362  // append the service pack info if available
363  osname += " ";
364  osname += osInfo.szCSDVersion;
365 
366  return osname;
367 }
368 
369 std::string
371 {
372  std::string CPUBrandString = aja::read_registry_string(HKEY_LOCAL_MACHINE,
373  "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
374  "ProcessorNameString");
375  return CPUBrandString;
376 }
377 
378 std::string
380 {
381  SYSTEM_INFO siSysInfo;
382  GetSystemInfo(&siSysInfo);
383  std::ostringstream oss;
384  oss << siSysInfo.dwNumberOfProcessors;
385  return oss.str();
386 }
387 
388 std::string
390 {
391  std::ostringstream oss;
392  DISPLAY_DEVICE devInfo;
393  devInfo.cb = sizeof(DISPLAY_DEVICE);
394  DWORD loopDevNum = 0;
395  std::map<std::string, int> foundMap;
396  while (EnumDisplayDevices(NULL, loopDevNum, &devInfo, 0))
397  {
398  std::string name = devInfo.DeviceString;
399  if (foundMap.find(name) == foundMap.end())
400  {
401  if (foundMap.empty() == false)
402  oss << ", ";
403 
404  oss << name;
405  foundMap[name] = 1;
406  }
407  loopDevNum++;
408  }
409  return oss.str();
410 }
411 
412 void
413 aja_getmemory(AJASystemInfoMemoryUnit units, std::string &total, std::string &used, std::string &free)
414 {
415  MEMORYSTATUSEX statex;
416  statex.dwLength = sizeof (statex);
417  GlobalMemoryStatusEx (&statex);
418 
419  int64_t memtotalbytes = statex.ullTotalPhys;
420  int64_t memfreebytes = statex.ullAvailPhys;
421  int64_t memusedbytes = memtotalbytes - memfreebytes;
422 
423  std::string unitsLabel;
424  double divisor = 1.0;
425  switch(units)
426  {
427  default:
429  unitsLabel = "B";
430  break;
432  unitsLabel = "KB";
433  divisor = 1024.0;
434  break;
436  unitsLabel = "MB";
437  divisor = 1048576.0;
438  break;
440  unitsLabel = "GB";
441  divisor = 1073741824.0;
442  break;
443  }
444 
445  std::ostringstream t,u,f;
446  t << int64_t(memtotalbytes / divisor) << " " << unitsLabel;
447  u << int64_t(memusedbytes / divisor) << " " << unitsLabel;
448  f << int64_t(memfreebytes / divisor) << " " << unitsLabel;
449 
450  total = t.str();
451  used = u.str();
452  free = f.str();
453 }
454 
455 std::string
457 {
458  //At some point circa Windows 10, Reg Key DisplayVersion began to be used instead of ReleaseId. Check for that first.
459  std::string outVal;
460  outVal = aja::read_registry_string(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
461  "DisplayVersion");
462  if (outVal == "")
463  outVal = aja::read_registry_string(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
464  "ReleaseId");
465 
466  return outVal;
467 }
468 
469 std::string
471 {
472  std::ostringstream oss;
473  std::string key_path = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
474  oss << aja::read_registry_string(HKEY_LOCAL_MACHINE, key_path, "CurrentBuild") <<
475  "." << aja::read_registry_dword(HKEY_LOCAL_MACHINE, key_path, "UBR");
476 
477  return oss.str();
478 }
479 
480 std::string
481 aja_mkpath_to_user_dir(const std::string& username)
482 {
483  std::string path;
484 
485  path.append(getenv("SystemDrive"));
486  path.append("\\Users\\");
487  if (username.find('\\') != std::string::npos)
488  {
489  //strip off anything before a "\\"
490  path.append(username.substr(username.find('\\') + 1));
491  }
492  else
493  {
494  path.append(username);
495  }
496 
497  return path;
498 }
499 
500 
501 
503 {
504  mMemoryUnits = units;
505 }
506 
508 {
509 
510 }
511 
512 AJAStatus
514 
515 
516 {
518 
519  if (sections & AJA_SystemInfoSection_System)
520  {
525 
526  ret = AJA_STATUS_SUCCESS;
527  }
528 
529  if (sections & AJA_SystemInfoSection_OS)
530  {
534  //mValueMap[int(AJA_SystemInfoTag_OS_KernelVersion)] // don't really have anything for this on Windows
535 
536  ret = AJA_STATUS_SUCCESS;
537  }
538 
539  if (sections & AJA_SystemInfoSection_CPU)
540  {
543 
544  ret = AJA_STATUS_SUCCESS;
545  }
546 
547  if (sections & AJA_SystemInfoSection_Mem)
548  {
553 
554  ret = AJA_STATUS_SUCCESS;
555  }
556 
557  if (sections & AJA_SystemInfoSection_GPU)
558  {
560 
561  ret = AJA_STATUS_SUCCESS;
562  }
563 
564  if (sections & AJA_SystemInfoSection_Path)
565  {
566  std::string path;
567 
568  // We try 4 different ways to get the path to the user's home directory,
569  // We start by using a system call and the try reading directly from the registry
570  // so we can use this within a service.
571  // 0) Read the path to the user home directory via SHGetFolderPathA()
572  // ISSUES
573  // - Does not work so well if used from a service, in this case it will return:
574  // C:\WINDOWS\system32\config\systemprofile
575  // 1) Read a value from HKEY_CURRENT_USER\Volatile Environment
576  // ISSUES
577  // - Does not work so well if used from a service, in this case it will return user 'SYSTEM'
578  // 2) Read a value from HKEY_LOCAL_MACHINE...\Authentication
579  // ISSUES
580  // - Does not work so well if multiple users logged in and the user using the desktop was
581  // not the last one logged into the machine.
582  // 3) As a last attempt use an older method that does not work with microsoft id logins
583  // http://forums.codeguru.com/showthread.php?317367-To-get-current-Logged-in-user-name-from-within-a-service
584  // ISSUES
585  // - Same as #2 above
586 
587  bool usernameFound = false;
588 
589  // try method 0
590  {
591 
592  char szPath[MAX_PATH];
593  HRESULT hresult = SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, szPath);
594  if (hresult == S_OK)
595  {
596  path.append(szPath);
597 
598  std::vector<std::string> parts;
599  aja::split(path, '\\', parts);
600  std::string username;
601  if (parts.size() > 0)
602  username = parts.at(parts.size()-1);
603 
604  if (!path.empty() && username != "systemprofile" && PathFileExistsA(path.c_str()))
605  usernameFound = true;
606  }
607  }
608 
609  // try method 1
610  if (!usernameFound)
611  {
612  std::string regVal = aja::read_registry_string(HKEY_CURRENT_USER,
613  "Volatile Environment",
614  "USERNAME");
615  if (!regVal.empty() && regVal != "SYSTEM")
616  {
617  path = aja_mkpath_to_user_dir(regVal);
618  if (!path.empty() && PathFileExistsA(path.c_str()))
619  usernameFound = true;
620  }
621  }
622 
623  // try method 2
624  if (!usernameFound)
625  {
626  std::string regVal = aja::read_registry_string(HKEY_LOCAL_MACHINE,
627  "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Authentication\\LogonUI",
628  "LastLoggedOnUser");
629  if (!regVal.empty())
630  {
631  path = aja_mkpath_to_user_dir(regVal);
632  if (!path.empty() && PathFileExistsA(path.c_str()))
633  usernameFound = true;
634  }
635  }
636 
637  // try method 3
638  if (!usernameFound)
639  {
640  std::string regVal = aja::read_registry_string(HKEY_LOCAL_MACHINE,
641  "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
642  "LastUsedUsername");
643  if (!regVal.empty())
644  {
645  path = aja_mkpath_to_user_dir(regVal);
646  if (!path.empty() && PathFileExistsA(path.c_str()))
647  usernameFound = true;
648  }
649  }
650 
651  if (!usernameFound)
652  {
653  // as a last resort set to nothing, if nothing else makes the error more obvious
654  path = "";
655  }
657 
658  if (usernameFound)
659  {
660  path.append("\\AppData\\Local\\AJA\\");
661  }
663 
664  TCHAR szPath[MAX_PATH];
665  HRESULT r;
666  r = SHGetFolderPath(NULL,CSIDL_COMMON_APPDATA,NULL,0,szPath);
667  if(r != S_OK)
668  {
669  //error
670  }
671  else
672  {
673  path.erase();
674  #ifdef UNICODE
675  PathAppend(szPath, L"AJA\\");
676  char tmpPath[MAX_PATH];
677  ::wcstombs(tmpPath,szPath,MAX_PATH);
678  path.append(tmpPath);
679  #else
680  PathAppend(szPath, "AJA\\");
681  path.append(szPath);
682  #endif
684  path.append("ntv2\\Firmware\\");
686  }
687 
688  mValueMap[int(AJA_SystemInfoTag_Path_Applications)] = "C:\\Program Files\\AJA\\windows\\Applications\\";
689  mValueMap[int(AJA_SystemInfoTag_Path_Utilities)] = "C:\\Program Files\\AJA\\windows\\Applications\\";
690 
691  ret = AJA_STATUS_SUCCESS;
692  } //end if (sections & AJA_SystemInfoSection_Path)
693 
694  return ret;
695 }
696 
697 //
698 
AJA_SystemInfoSection_Path
@ AJA_SystemInfoSection_Path
Definition: info.h:61
MAX_PATH
#define MAX_PATH
Definition: ajatypes.h:329
aja_getsystemmodel
std::string aja_getsystemmodel()
Definition: infoimpl.cpp:48
aja_getosversionbuild
std::string aja_getosversionbuild()
Definition: infoimpl.cpp:470
info.h
Declares the AJASystemInfo class.
aja_getcpucores
std::string aja_getcpucores()
Definition: infoimpl.cpp:379
AJA_SystemInfoMemoryUnit_Megabytes
@ AJA_SystemInfoMemoryUnit_Megabytes
Definition: info.h:23
AJA_SystemInfoTag_System_Bios
@ AJA_SystemInfoTag_System_Bios
Definition: info.h:32
AJA_SystemInfoSection_CPU
@ AJA_SystemInfoSection_CPU
Definition: info.h:57
NULL
#define NULL
Definition: ntv2caption608types.h:19
AJA_STATUS_SUCCESS
@ AJA_STATUS_SUCCESS
Definition: types.h:381
aja::split
void split(const std::string &str, const char delim, std::vector< std::string > &elems)
Definition: common.cpp:350
AJA_SystemInfoTag_Path_Firmware
@ AJA_SystemInfoTag_Path_Firmware
Definition: info.h:50
AJASystemInfoMemoryUnit
AJASystemInfoMemoryUnit
Definition: info.h:19
AJASystemInfoImpl::mMemoryUnits
int mMemoryUnits
Definition: infoimpl.h:26
AJA_SystemInfoTag_Path_Applications
@ AJA_SystemInfoTag_Path_Applications
Definition: info.h:48
AJASystemInfoImpl::~AJASystemInfoImpl
virtual ~AJASystemInfoImpl()
Definition: infoimpl.cpp:251
aja_getboottime
std::string aja_getboottime()
Definition: infoimpl.cpp:97
AJA_SystemInfoMemoryUnit_Kilobytes
@ AJA_SystemInfoMemoryUnit_Kilobytes
Definition: info.h:22
AJA_SystemInfoTag_CPU_Type
@ AJA_SystemInfoTag_CPU_Type
Definition: info.h:39
aja_getosversion
std::string aja_getosversion()
Definition: infoimpl.cpp:456
WindowsVersionEntry::minor
int minor
Definition: infoimpl.cpp:29
WindowsVersionEntry::major
int major
Definition: infoimpl.cpp:28
AJAStatus
AJAStatus
Definition: types.h:378
AJA_SystemInfoTag_CPU_NumCores
@ AJA_SystemInfoTag_CPU_NumCores
Definition: info.h:40
AJA_STATUS_FAIL
@ AJA_STATUS_FAIL
Definition: types.h:382
AJA_SystemInfoTag_System_Name
@ AJA_SystemInfoTag_System_Name
Definition: info.h:33
AJASystemInfoImpl::mValueMap
std::map< int, std::string > mValueMap
Definition: infoimpl.h:24
AJA_SystemInfoTag_System_BootTime
@ AJA_SystemInfoTag_System_BootTime
Definition: info.h:34
AJA_SystemInfoTag_OS_Version
@ AJA_SystemInfoTag_OS_Version
Definition: info.h:36
AJA_SystemInfoTag_Mem_Used
@ AJA_SystemInfoTag_Mem_Used
Definition: info.h:42
aja_getmemory
void aja_getmemory(AJASystemInfoMemoryUnit units, std::string &total, std::string &used, std::string &free)
Definition: infoimpl.cpp:413
WindowsVersionTableSize
const int WindowsVersionTableSize
Definition: infoimpl.cpp:45
AJA_SystemInfoSection_GPU
@ AJA_SystemInfoSection_GPU
Definition: info.h:58
WindowsVersionEntry
Definition: infoimpl.cpp:26
AJA_SystemInfoTag_Path_PersistenceStoreUser
@ AJA_SystemInfoTag_Path_PersistenceStoreUser
Definition: info.h:46
AJASystemInfoSections
AJASystemInfoSections
Definition: info.h:55
AJASystemInfoImpl::AJASystemInfoImpl
AJASystemInfoImpl(int units)
Definition: infoimpl.cpp:246
aja_getcputype
std::string aja_getcputype()
Definition: infoimpl.cpp:370
AJA_SystemInfoTag_Path_PersistenceStoreSystem
@ AJA_SystemInfoTag_Path_PersistenceStoreSystem
Definition: info.h:47
system.h
System specific functions.
AJA_SystemInfoMemoryUnit_Gigabytes
@ AJA_SystemInfoMemoryUnit_Gigabytes
Definition: info.h:24
AJA_SystemInfoTag_OS_ProductName
@ AJA_SystemInfoTag_OS_ProductName
Definition: info.h:35
infoimpl.h
Declares the AJASystemInfoImpl class.
getOSName_WMI
static std::string getOSName_WMI()
Definition: infoimpl.cpp:143
AJA_SystemInfoSection_OS
@ AJA_SystemInfoSection_OS
Definition: info.h:60
WindowsVersionEntry::serverName
char * serverName
Definition: infoimpl.cpp:31
AJA_SystemInfoTag_Path_Utilities
@ AJA_SystemInfoTag_Path_Utilities
Definition: info.h:49
AJA_SystemInfoTag_Path_UserHome
@ AJA_SystemInfoTag_Path_UserHome
Definition: info.h:45
AJASystemInfoImpl::Rescan
virtual AJAStatus Rescan(AJASystemInfoSections sections)
Definition: infoimpl.cpp:257
AJA_SystemInfoSection_Mem
@ AJA_SystemInfoSection_Mem
Definition: info.h:59
aja_getsystembios
std::string aja_getsystembios()
Definition: infoimpl.cpp:67
AJA_SystemInfoTag_Mem_Free
@ AJA_SystemInfoTag_Mem_Free
Definition: info.h:43
AJA_SystemInfoTag_GPU_Type
@ AJA_SystemInfoTag_GPU_Type
Definition: info.h:44
WindowsVersionTable
const WindowsVersionEntry WindowsVersionTable[]
Definition: infoimpl.cpp:34
aja_getgputype
std::string aja_getgputype()
Definition: infoimpl.cpp:162
aja_getosname
std::string aja_getosname()
Definition: infoimpl.cpp:277
WindowsVersionEntry::workstationName
char * workstationName
Definition: infoimpl.cpp:30
AJA_SystemInfoTag_OS_VersionBuild
@ AJA_SystemInfoTag_OS_VersionBuild
Definition: info.h:37
AJA_SystemInfoMemoryUnit_Bytes
@ AJA_SystemInfoMemoryUnit_Bytes
Definition: info.h:21
aja_getsystemname
std::string aja_getsystemname()
Definition: infoimpl.cpp:83
AJA_SystemInfoSection_System
@ AJA_SystemInfoSection_System
Definition: info.h:62
AJA_SystemInfoTag_Mem_Total
@ AJA_SystemInfoTag_Mem_Total
Definition: info.h:41
AJA_SystemInfoTag_System_Model
@ AJA_SystemInfoTag_System_Model
Definition: info.h:31
aja_mkpath_to_user_dir
std::string aja_mkpath_to_user_dir(const std::string &username)
Definition: infoimpl.cpp:481