AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
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  // get CPU info
373  int CPUInfo[4] = {-1};
374  char CPUBrandString[0x40];
375  __cpuid(CPUInfo, 0x80000000);
376  unsigned int nExIds = CPUInfo[0];
377  memset(CPUBrandString, 0, sizeof(CPUBrandString));
378  for (unsigned int i=0x80000000; i<=nExIds; ++i)
379  {
380  // Get the information associated with each extended ID.
381  __cpuid(CPUInfo, i);
382  // Interpret CPU brand string.
383  if (i == 0x80000002)
384  memcpy(CPUBrandString, CPUInfo, sizeof(CPUInfo));
385  else if (i == 0x80000003)
386  memcpy(CPUBrandString + 16, CPUInfo, sizeof(CPUInfo));
387  else if (i == 0x80000004)
388  memcpy(CPUBrandString + 32, CPUInfo, sizeof(CPUInfo));
389  }
390 
391  return CPUBrandString;
392 }
393 
394 std::string
396 {
397  SYSTEM_INFO siSysInfo;
398  GetSystemInfo(&siSysInfo);
399  std::ostringstream oss;
400  oss << siSysInfo.dwNumberOfProcessors;
401  return oss.str();
402 }
403 
404 std::string
406 {
407  std::ostringstream oss;
408  DISPLAY_DEVICE devInfo;
409  devInfo.cb = sizeof(DISPLAY_DEVICE);
410  DWORD loopDevNum = 0;
411  std::map<std::string, int> foundMap;
412  while (EnumDisplayDevices(NULL, loopDevNum, &devInfo, 0))
413  {
414  std::string name = devInfo.DeviceString;
415  if (foundMap.find(name) == foundMap.end())
416  {
417  if (foundMap.empty() == false)
418  oss << ", ";
419 
420  oss << name;
421  foundMap[name] = 1;
422  }
423  loopDevNum++;
424  }
425  return oss.str();
426 }
427 
428 void
429 aja_getmemory(AJASystemInfoMemoryUnit units, std::string &total, std::string &used, std::string &free)
430 {
431  MEMORYSTATUSEX statex;
432  statex.dwLength = sizeof (statex);
433  GlobalMemoryStatusEx (&statex);
434 
435  int64_t memtotalbytes = statex.ullTotalPhys;
436  int64_t memfreebytes = statex.ullAvailPhys;
437  int64_t memusedbytes = memtotalbytes - memfreebytes;
438 
439  std::string unitsLabel;
440  double divisor = 1.0;
441  switch(units)
442  {
443  default:
445  unitsLabel = "B";
446  break;
448  unitsLabel = "KB";
449  divisor = 1024.0;
450  break;
452  unitsLabel = "MB";
453  divisor = 1048576.0;
454  break;
456  unitsLabel = "GB";
457  divisor = 1073741824.0;
458  break;
459  }
460 
461  std::ostringstream t,u,f;
462  t << int64_t(memtotalbytes / divisor) << " " << unitsLabel;
463  u << int64_t(memusedbytes / divisor) << " " << unitsLabel;
464  f << int64_t(memfreebytes / divisor) << " " << unitsLabel;
465 
466  total = t.str();
467  used = u.str();
468  free = f.str();
469 }
470 
471 std::string
473 {
474  //At some point circa Windows 10, Reg Key DisplayVersion began to be used instead of ReleaseId. Check for that first.
475  std::string outVal;
476  outVal = aja::read_registry_string(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
477  "DisplayVersion");
478  if (outVal == "")
479  outVal = aja::read_registry_string(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
480  "ReleaseId");
481 
482  return outVal;
483 }
484 
485 std::string
487 {
488  std::ostringstream oss;
489  std::string key_path = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
490  oss << aja::read_registry_string(HKEY_LOCAL_MACHINE, key_path, "CurrentBuild") <<
491  "." << aja::read_registry_dword(HKEY_LOCAL_MACHINE, key_path, "UBR");
492 
493  return oss.str();
494 }
495 
496 std::string
497 aja_mkpath_to_user_dir(const std::string& username)
498 {
499  std::string path;
500 
501  path.append(getenv("SystemDrive"));
502  path.append("\\Users\\");
503  if (username.find('\\') != std::string::npos)
504  {
505  //strip off anything before a "\\"
506  path.append(username.substr(username.find('\\') + 1));
507  }
508  else
509  {
510  path.append(username);
511  }
512 
513  return path;
514 }
515 
516 
517 
519 {
520  mMemoryUnits = units;
521 }
522 
524 {
525 
526 }
527 
528 AJAStatus
530 
531 
532 {
534 
535  if (sections & AJA_SystemInfoSection_System)
536  {
541 
542  ret = AJA_STATUS_SUCCESS;
543  }
544 
545  if (sections & AJA_SystemInfoSection_OS)
546  {
550  //mValueMap[int(AJA_SystemInfoTag_OS_KernelVersion)] // don't really have anything for this on Windows
551 
552  ret = AJA_STATUS_SUCCESS;
553  }
554 
555  if (sections & AJA_SystemInfoSection_CPU)
556  {
559 
560  ret = AJA_STATUS_SUCCESS;
561  }
562 
563  if (sections & AJA_SystemInfoSection_Mem)
564  {
569 
570  ret = AJA_STATUS_SUCCESS;
571  }
572 
573  if (sections & AJA_SystemInfoSection_GPU)
574  {
576 
577  ret = AJA_STATUS_SUCCESS;
578  }
579 
580  if (sections & AJA_SystemInfoSection_Path)
581  {
582  std::string path;
583 
584  // We try 4 different ways to get the path to the user's home directory,
585  // We start by using a system call and the try reading directly from the registry
586  // so we can use this within a service.
587  // 0) Read the path to the user home directory via SHGetFolderPathA()
588  // ISSUES
589  // - Does not work so well if used from a service, in this case it will return:
590  // C:\WINDOWS\system32\config\systemprofile
591  // 1) Read a value from HKEY_CURRENT_USER\Volatile Environment
592  // ISSUES
593  // - Does not work so well if used from a service, in this case it will return user 'SYSTEM'
594  // 2) Read a value from HKEY_LOCAL_MACHINE...\Authentication
595  // ISSUES
596  // - Does not work so well if multiple users logged in and the user using the desktop was
597  // not the last one logged into the machine.
598  // 3) As a last attempt use an older method that does not work with microsoft id logins
599  // http://forums.codeguru.com/showthread.php?317367-To-get-current-Logged-in-user-name-from-within-a-service
600  // ISSUES
601  // - Same as #2 above
602 
603  bool usernameFound = false;
604 
605  // try method 0
606  {
607 
608  char szPath[MAX_PATH];
609  HRESULT hresult = SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, szPath);
610  if (hresult == S_OK)
611  {
612  path.append(szPath);
613 
614  std::vector<std::string> parts;
615  aja::split(path, '\\', parts);
616  std::string username;
617  if (parts.size() > 0)
618  username = parts.at(parts.size()-1);
619 
620  if (!path.empty() && username != "systemprofile" && PathFileExistsA(path.c_str()))
621  usernameFound = true;
622  }
623  }
624 
625  // try method 1
626  if (!usernameFound)
627  {
628  std::string regVal = aja::read_registry_string(HKEY_CURRENT_USER,
629  "Volatile Environment",
630  "USERNAME");
631  if (!regVal.empty() && regVal != "SYSTEM")
632  {
633  path = aja_mkpath_to_user_dir(regVal);
634  if (!path.empty() && PathFileExistsA(path.c_str()))
635  usernameFound = true;
636  }
637  }
638 
639  // try method 2
640  if (!usernameFound)
641  {
642  std::string regVal = aja::read_registry_string(HKEY_LOCAL_MACHINE,
643  "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Authentication\\LogonUI",
644  "LastLoggedOnUser");
645  if (!regVal.empty())
646  {
647  path = aja_mkpath_to_user_dir(regVal);
648  if (!path.empty() && PathFileExistsA(path.c_str()))
649  usernameFound = true;
650  }
651  }
652 
653  // try method 3
654  if (!usernameFound)
655  {
656  std::string regVal = aja::read_registry_string(HKEY_LOCAL_MACHINE,
657  "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
658  "LastUsedUsername");
659  if (!regVal.empty())
660  {
661  path = aja_mkpath_to_user_dir(regVal);
662  if (!path.empty() && PathFileExistsA(path.c_str()))
663  usernameFound = true;
664  }
665  }
666 
667  if (!usernameFound)
668  {
669  // as a last resort set to nothing, if nothing else makes the error more obvious
670  path = "";
671  }
673 
674  if (usernameFound)
675  {
676  path.append("\\AppData\\Local\\AJA\\");
677  }
679 
680  TCHAR szPath[MAX_PATH];
681  HRESULT r;
682  r = SHGetFolderPath(NULL,CSIDL_COMMON_APPDATA,NULL,0,szPath);
683  if(r != S_OK)
684  {
685  //error
686  }
687  else
688  {
689  path.erase();
690  #ifdef UNICODE
691  PathAppend(szPath, L"AJA\\");
692  char tmpPath[MAX_PATH];
693  ::wcstombs(tmpPath,szPath,MAX_PATH);
694  path.append(tmpPath);
695  #else
696  PathAppend(szPath, "AJA\\");
697  path.append(szPath);
698  #endif
700  path.append("ntv2\\Firmware\\");
702  }
703 
704  mValueMap[int(AJA_SystemInfoTag_Path_Applications)] = "C:\\Program Files\\AJA\\windows\\Applications\\";
705  mValueMap[int(AJA_SystemInfoTag_Path_Utilities)] = "C:\\Program Files\\AJA\\windows\\Applications\\";
706 
707  ret = AJA_STATUS_SUCCESS;
708  } //end if (sections & AJA_SystemInfoSection_Path)
709 
710  return ret;
711 }
712 
713 //
714 
AJA_SystemInfoSection_Path
@ AJA_SystemInfoSection_Path
Definition: info.h:61
MAX_PATH
#define MAX_PATH
Definition: ajatypes.h:327
aja_getsystemmodel
std::string aja_getsystemmodel()
Definition: infoimpl.cpp:48
aja_getosversionbuild
std::string aja_getosversionbuild()
Definition: infoimpl.cpp:486
info.h
Declares the AJASystemInfo class.
aja_getcpucores
std::string aja_getcpucores()
Definition: infoimpl.cpp:395
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:472
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:429
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:497