Panda3D
displayInformation.cxx
1 // Filename: displayInformation.cxx
2 // Created by: aignacio (17Jan07)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "graphicsStateGuardian.h"
16 #include "displayInformation.h"
17 
18 ////////////////////////////////////////////////////////////////////
19 // Function: DisplayMode::Comparison Operator
20 // Access: Published
21 // Description: Returns true if these two DisplayModes are identical.
22 ////////////////////////////////////////////////////////////////////
23 bool DisplayMode::
24 operator == (const DisplayMode &other) const {
25  return (width == other.width && height == other.height &&
26  bits_per_pixel == other.bits_per_pixel &&
27  refresh_rate == other.refresh_rate &&
28  fullscreen_only == other.fullscreen_only);
29 }
30 
31 ////////////////////////////////////////////////////////////////////
32 // Function: DisplayMode::Comparison Operator
33 // Access: Published
34 // Description: Returns false if these two DisplayModes are identical.
35 ////////////////////////////////////////////////////////////////////
36 bool DisplayMode::
37 operator != (const DisplayMode &other) const {
38  return !operator == (other);
39 }
40 
41 ////////////////////////////////////////////////////////////////////
42 // Function: DisplayMode::output
43 // Access: Published
44 // Description:
45 ////////////////////////////////////////////////////////////////////
46 void DisplayMode::
47 output(ostream &out) const {
48  out << width << 'x' << height;
49  if (bits_per_pixel > 0) {
50  out << ' ' << bits_per_pixel << "bpp";
51  }
52  if (refresh_rate > 0) {
53  out << ' ' << refresh_rate << "Hz";
54  }
55  if (fullscreen_only > 0) {
56  out << " (fullscreen only)";
57  }
58 }
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function: DisplayInformation::Destructor
62 // Access: Published
63 // Description:
64 ////////////////////////////////////////////////////////////////////
65 DisplayInformation::
66 ~DisplayInformation() {
67  if (_display_mode_array != NULL) {
68  delete[] _display_mode_array;
69  }
70  if (_cpu_id_data != NULL) {
71  delete _cpu_id_data;
72  }
73  if (_cpu_brand_string != NULL) {
74  delete _cpu_brand_string;
75  }
76 }
77 
78 ////////////////////////////////////////////////////////////////////
79 // Function: DisplayInformation::Constructor
80 // Access: Published
81 // Description:
82 ////////////////////////////////////////////////////////////////////
83 DisplayInformation::
84 DisplayInformation() {
85  DisplayInformation::DetectionState state;
86  int get_adapter_display_mode_state;
87  int get_device_caps_state;
88  int window_width;
89  int window_height;
90  int window_bits_per_pixel;
91  int total_display_modes;
92  DisplayMode *display_mode_array;
93  int shader_model;
94  int video_memory;
95  int texture_memory;
96  PN_uint64 physical_memory;
97  PN_uint64 available_physical_memory;
98 
99  state = DisplayInformation::DS_unknown;
100  get_adapter_display_mode_state = false;
101  get_device_caps_state = false;
102  window_width = 0;
103  window_height = 0;
104  window_bits_per_pixel = 0;
105  total_display_modes = 0;
106  display_mode_array = NULL;
107  shader_model = GraphicsStateGuardian::SM_00;
108  video_memory = 0;
109  texture_memory = 0;
110  physical_memory = 0;
111  available_physical_memory = 0;
112 
113  _state = state;
114  _get_adapter_display_mode_state = get_adapter_display_mode_state;
115  _get_device_caps_state = get_device_caps_state;
116  _maximum_window_width = window_width;
117  _maximum_window_height = window_height;
118  _window_bits_per_pixel = window_bits_per_pixel;
119  _total_display_modes = total_display_modes;
120  _display_mode_array = display_mode_array;
121  _shader_model = shader_model;
122  _video_memory = video_memory;
123  _texture_memory = texture_memory;
124 
125  _physical_memory = physical_memory;
126  _available_physical_memory = available_physical_memory;
127  _page_file_size = 0;
128  _available_page_file_size = 0;
129  _process_virtual_memory = 0;
130  _available_process_virtual_memory = 0;
131  _memory_load = 0;
132  _page_fault_count = 0;
133  _process_memory = 0;
134  _peak_process_memory = 0;
135  _page_file_usage = 0;
136  _peak_page_file_usage = 0;
137 
138  _vendor_id = 0;
139  _device_id = 0;
140 
141  _driver_product = 0;
142  _driver_version = 0;
143  _driver_sub_version = 0;
144  _driver_build = 0;
145 
146  _driver_date_month = 0;
147  _driver_date_day = 0;
148  _driver_date_year = 0;
149 
150  _cpu_id_version = 1;
151  _cpu_id_size = 0;
152  _cpu_id_data = 0;
153 
154  _cpu_vendor_string = 0;
155  _cpu_brand_string = 0;
156  _cpu_version_information = 0;
157  _cpu_brand_index = 0;
158 
159  _cpu_frequency = 0;
160 
161  _maximum_cpu_frequency = 0;
162  _current_cpu_frequency = 0;
163 
164  _num_cpu_cores = 0;
165  _num_logical_cpus = 0;
166 
167  _get_memory_information_function = 0;
168  _cpu_time_function = 0;
169  _update_cpu_frequency_function = 0;
170 
171  _os_version_major = -1;
172  _os_version_minor = -1;
173  _os_version_build = -1;
174  _os_platform_id = -1;
175 }
176 
177 ////////////////////////////////////////////////////////////////////
178 // Function: DisplayInformation::
179 // Access: Published
180 // Description:
181 ////////////////////////////////////////////////////////////////////
182 int DisplayInformation::get_display_state() {
183  return _state;
184 }
185 
186 ////////////////////////////////////////////////////////////////////
187 // Function: DisplayInformation::get_maximum_window_width
188 // Access: Published
189 // Description:
190 ////////////////////////////////////////////////////////////////////
191 int DisplayInformation::
192 get_maximum_window_width() {
193  return _maximum_window_width;
194 }
195 
196 ////////////////////////////////////////////////////////////////////
197 // Function: DisplayInformation::get_maximum_window_height
198 // Access: Published
199 // Description:
200 ////////////////////////////////////////////////////////////////////
201 int DisplayInformation::
202 get_maximum_window_height() {
203  return _maximum_window_height;
204 }
205 
206 ////////////////////////////////////////////////////////////////////
207 // Function: DisplayInformation::get_window_bits_per_pixel
208 // Access: Published
209 // Description:
210 ////////////////////////////////////////////////////////////////////
211 int DisplayInformation::
212 get_window_bits_per_pixel() {
213  return _window_bits_per_pixel;
214 }
215 
216 ////////////////////////////////////////////////////////////////////
217 // Function: DisplayInformation::get_total_display_modes
218 // Access: Published
219 // Description:
220 ////////////////////////////////////////////////////////////////////
221 int DisplayInformation::
222 get_total_display_modes() {
223  return _total_display_modes;
224 }
225 
226 ////////////////////////////////////////////////////////////////////
227 // Function: DisplayInformation::get_display_mode
228 // Access: Published
229 // Description:
230 ////////////////////////////////////////////////////////////////////
231 const DisplayMode &DisplayInformation::
232 get_display_mode(int display_index) {
233 #ifndef NDEBUG
234  static DisplayMode err_mode = {0};
235  nassertr(display_index >= 0 && display_index < _total_display_modes, err_mode);
236 #endif
237 
238  return _display_mode_array[display_index];
239 }
240 
241 ////////////////////////////////////////////////////////////////////
242 // Function: DisplayInformation::get_display_mode_width
243 // Access: Published
244 // Description:
245 ////////////////////////////////////////////////////////////////////
246 int DisplayInformation::
247 get_display_mode_width (int display_index) {
248  int value;
249 
250  value = 0;
251  if (display_index >= 0 && display_index < _total_display_modes) {
252  value = _display_mode_array [display_index].width;
253  }
254 
255  return value;
256 }
257 
258 ////////////////////////////////////////////////////////////////////
259 // Function: DisplayInformation::get_display_mode_height
260 // Access: Published
261 // Description:
262 ////////////////////////////////////////////////////////////////////
263 int DisplayInformation::
264 get_display_mode_height (int display_index) {
265  int value;
266 
267  value = 0;
268  if (display_index >= 0 && display_index < _total_display_modes) {
269  value = _display_mode_array [display_index].height;
270  }
271 
272  return value;
273 }
274 
275 ////////////////////////////////////////////////////////////////////
276 // Function: DisplayInformation::get_display_mode_bits_per_pixel
277 // Access: Published
278 // Description:
279 ////////////////////////////////////////////////////////////////////
280 int DisplayInformation::
281 get_display_mode_bits_per_pixel (int display_index) {
282  int value;
283 
284  value = 0;
285  if (display_index >= 0 && display_index < _total_display_modes) {
286  value = _display_mode_array [display_index].bits_per_pixel;
287  }
288 
289  return value;
290 }
291 
292 ////////////////////////////////////////////////////////////////////
293 // Function: DisplayInformation::get_display_mode_refresh_rate
294 // Access: Published
295 // Description:
296 ////////////////////////////////////////////////////////////////////
297 int DisplayInformation::
298 get_display_mode_refresh_rate (int display_index) {
299  int value;
300 
301  value = 0;
302  if (display_index >= 0 && display_index < _total_display_modes) {
303  value = _display_mode_array [display_index].refresh_rate;
304  }
305 
306  return value;
307 }
308 
309 ////////////////////////////////////////////////////////////////////
310 // Function: DisplayInformation::get_display_mode_fullscreen_only
311 // Access: Published
312 // Description:
313 ////////////////////////////////////////////////////////////////////
314 int DisplayInformation::
315 get_display_mode_fullscreen_only (int display_index) {
316  int value;
317 
318  value = 0;
319  if (display_index >= 0 && display_index < _total_display_modes) {
320  value = _display_mode_array [display_index].fullscreen_only;
321  }
322 
323  return value;
324 }
325 
326 ////////////////////////////////////////////////////////////////////
327 // Function: DisplayInformation::get_shader_model
328 // Access: Published
329 // Description:
330 ////////////////////////////////////////////////////////////////////
331 int DisplayInformation::
332 get_shader_model ( ) {
333  return _shader_model;
334 }
335 
336 ////////////////////////////////////////////////////////////////////
337 // Function: DisplayInformation::get_video_memory
338 // Access: Published
339 // Description:
340 ////////////////////////////////////////////////////////////////////
341 int DisplayInformation::
342 get_video_memory ( ) {
343  return _video_memory;
344 }
345 
346 ////////////////////////////////////////////////////////////////////
347 // Function: DisplayInformation::get_texture_memory
348 // Access: Published
349 // Description:
350 ////////////////////////////////////////////////////////////////////
351 int DisplayInformation::
352 get_texture_memory() {
353  return _texture_memory;
354 }
355 
356 ////////////////////////////////////////////////////////////////////
357 // Function: DisplayInformation::update_memory_information
358 // Access: Published
359 // Description:
360 ////////////////////////////////////////////////////////////////////
361 void DisplayInformation::
362 update_memory_information() {
363  if (_get_memory_information_function) {
364  _get_memory_information_function (this);
365  }
366 }
367 
368 ////////////////////////////////////////////////////////////////////
369 // Function: DisplayInformation::get_physical_memory
370 // Access: Published
371 // Description:
372 ////////////////////////////////////////////////////////////////////
373 PN_uint64 DisplayInformation::
374 get_physical_memory() {
375  return _physical_memory;
376 }
377 
378 ////////////////////////////////////////////////////////////////////
379 // Function: DisplayInformation::get_available_physical_memory
380 // Access: Published
381 // Description:
382 ////////////////////////////////////////////////////////////////////
383 PN_uint64 DisplayInformation::
384 get_available_physical_memory() {
385  return _available_physical_memory;
386 }
387 
388 ////////////////////////////////////////////////////////////////////
389 // Function: DisplayInformation::get_page_file_size
390 // Access: Published
391 // Description:
392 ////////////////////////////////////////////////////////////////////
393 PN_uint64 DisplayInformation::
394 get_page_file_size() {
395  return _page_file_size;
396 }
397 
398 ////////////////////////////////////////////////////////////////////
399 // Function: DisplayInformation::get_available_page_file_size
400 // Access: Published
401 // Description:
402 ////////////////////////////////////////////////////////////////////
403 PN_uint64 DisplayInformation::
404 get_available_page_file_size() {
405  return _available_page_file_size;
406 }
407 
408 ////////////////////////////////////////////////////////////////////
409 // Function: DisplayInformation::_process_virtual_memory
410 // Access: Published
411 // Description:
412 ////////////////////////////////////////////////////////////////////
413 PN_uint64 DisplayInformation::
414 get_process_virtual_memory() {
415  return _process_virtual_memory;
416 }
417 
418 ////////////////////////////////////////////////////////////////////
419 // Function: DisplayInformation::get_available_process_virtual_memory
420 // Access: Published
421 // Description:
422 ////////////////////////////////////////////////////////////////////
423 PN_uint64 DisplayInformation::
424 get_available_process_virtual_memory() {
425  return _available_process_virtual_memory;
426 }
427 
428 ////////////////////////////////////////////////////////////////////
429 // Function: DisplayInformation::get_memory_load
430 // Access: Published
431 // Description:
432 ////////////////////////////////////////////////////////////////////
433 int DisplayInformation::
434 get_memory_load() {
435  return _memory_load;
436 }
437 
438 ////////////////////////////////////////////////////////////////////
439 // Function: DisplayInformation::get_page_fault_count
440 // Access: Published
441 // Description:
442 ////////////////////////////////////////////////////////////////////
443 PN_uint64 DisplayInformation::
444 get_page_fault_count() {
445  return _page_fault_count;
446 }
447 
448 ////////////////////////////////////////////////////////////////////
449 // Function: DisplayInformation::get_process_memory
450 // Access: Published
451 // Description:
452 ////////////////////////////////////////////////////////////////////
453 PN_uint64 DisplayInformation::
454 get_process_memory() {
455  return _process_memory;
456 }
457 
458 ////////////////////////////////////////////////////////////////////
459 // Function: DisplayInformation::get_peak_process_memory
460 // Access: Published
461 // Description:
462 ////////////////////////////////////////////////////////////////////
463 PN_uint64 DisplayInformation::
464 get_peak_process_memory() {
465  return _peak_process_memory;
466 }
467 
468 ////////////////////////////////////////////////////////////////////
469 // Function: DisplayInformation::get_page_file_usage
470 // Access: Published
471 // Description:
472 ////////////////////////////////////////////////////////////////////
473 PN_uint64 DisplayInformation::
474 get_page_file_usage() {
475  return _page_file_usage;
476 }
477 
478 ////////////////////////////////////////////////////////////////////
479 // Function: DisplayInformation::get_peak_page_file_usage
480 // Access: Published
481 // Description:
482 ////////////////////////////////////////////////////////////////////
483 PN_uint64 DisplayInformation::
484 get_peak_page_file_usage() {
485  return _peak_page_file_usage;
486 }
487 
488 ////////////////////////////////////////////////////////////////////
489 // Function: DisplayInformation::get_vendor_id
490 // Access: Published
491 // Description:
492 ////////////////////////////////////////////////////////////////////
493 int DisplayInformation::
494 get_vendor_id() {
495  return _vendor_id;
496 }
497 
498 ////////////////////////////////////////////////////////////////////
499 // Function: DisplayInformation::get_device_id
500 // Access: Published
501 // Description:
502 ////////////////////////////////////////////////////////////////////
503 int DisplayInformation::
504 get_device_id() {
505  return _device_id;
506 }
507 
508 ////////////////////////////////////////////////////////////////////
509 // Function: DisplayInformation::get_driver_product
510 // Access: Published
511 // Description:
512 ////////////////////////////////////////////////////////////////////
513 int DisplayInformation::
514 get_driver_product() {
515  return _driver_product;
516 }
517 
518 ////////////////////////////////////////////////////////////////////
519 // Function: DisplayInformation::get_driver_version
520 // Access: Published
521 // Description:
522 ////////////////////////////////////////////////////////////////////
523 int DisplayInformation::
524 get_driver_version() {
525  return _driver_version;
526 }
527 
528 ////////////////////////////////////////////////////////////////////
529 // Function: DisplayInformation::get_driver_sub_version
530 // Access: Published
531 // Description:
532 ////////////////////////////////////////////////////////////////////
533 int DisplayInformation::
534 get_driver_sub_version() {
535  return _driver_sub_version;
536 }
537 
538 ////////////////////////////////////////////////////////////////////
539 // Function: DisplayInformation::get_driver_build
540 // Access: Published
541 // Description:
542 ////////////////////////////////////////////////////////////////////
543 int DisplayInformation::
544 get_driver_build() {
545  return _driver_build;
546 }
547 
548 ////////////////////////////////////////////////////////////////////
549 // Function: DisplayInformation::get_driver_date_month
550 // Access: Published
551 // Description:
552 ////////////////////////////////////////////////////////////////////
553 int DisplayInformation::
554 get_driver_date_month() {
555  return _driver_date_month;
556 }
557 
558 ////////////////////////////////////////////////////////////////////
559 // Function: DisplayInformation::get_driver_date_day
560 // Access: Published
561 // Description:
562 ////////////////////////////////////////////////////////////////////
563 int DisplayInformation::
564 get_driver_date_day() {
565  return _driver_date_day;
566 }
567 
568 ////////////////////////////////////////////////////////////////////
569 // Function: DisplayInformation::get_driver_date_year
570 // Access: Published
571 // Description:
572 ////////////////////////////////////////////////////////////////////
573 int DisplayInformation::
574 get_driver_date_year() {
575  return _driver_date_year;
576 }
577 
578 ////////////////////////////////////////////////////////////////////
579 // Function: DisplayInformation::get_cpu_id_version
580 // Access: Published
581 // Description:
582 ////////////////////////////////////////////////////////////////////
583 int DisplayInformation::
584 get_cpu_id_version() {
585  return _cpu_id_version;
586 }
587 
588 ////////////////////////////////////////////////////////////////////
589 // Function: DisplayInformation::get_cpu_id_size
590 // Access: Published
591 // Description: Returns the number of 32-bit values for cpu id
592 // binary data.
593 ////////////////////////////////////////////////////////////////////
596  return _cpu_id_size;
597 }
598 
599 ////////////////////////////////////////////////////////////////////
600 // Function: DisplayInformation::get_cpu_id_data
601 // Access: Published
602 // Description: Returns part of cpu id binary data based on the
603 // index.
604 ////////////////////////////////////////////////////////////////////
605 unsigned int DisplayInformation::
606 get_cpu_id_data(int index) {
607  unsigned int data;
608 
609  data = 0;
610  if (index >= 0 && index < _cpu_id_size) {
611  data = _cpu_id_data [index];
612  }
613 
614  return data;
615 }
616 
617 ////////////////////////////////////////////////////////////////////
618 // Function: DisplayInformation::get_cpu_vendor_string
619 // Access: Published
620 // Description:
621 ////////////////////////////////////////////////////////////////////
622 const char *DisplayInformation::
623 get_cpu_vendor_string() {
624  const char *string;
625 
626  string = _cpu_vendor_string;
627  if (string == 0) {
628  string = "";
629  }
630 
631  return string;
632 }
633 
634 ////////////////////////////////////////////////////////////////////
635 // Function: DisplayInformation::get_cpu_brand_string
636 // Access: Published
637 // Description:
638 ////////////////////////////////////////////////////////////////////
639 const char *DisplayInformation::
640 get_cpu_brand_string() {
641  const char *string;
642 
643  string = _cpu_brand_string;
644  if (string == 0) {
645  string = "";
646  }
647 
648  return string;
649 }
650 
651 ////////////////////////////////////////////////////////////////////
652 // Function: DisplayInformation::get_cpu_version_information
653 // Access: Published
654 // Description:
655 ////////////////////////////////////////////////////////////////////
656 unsigned int DisplayInformation::
657 get_cpu_version_information() {
658  return _cpu_version_information;
659 }
660 
661 ////////////////////////////////////////////////////////////////////
662 // Function: DisplayInformation::get_cpu_brand_index
663 // Access: Published
664 // Description:
665 ////////////////////////////////////////////////////////////////////
666 unsigned int DisplayInformation::
667 get_cpu_brand_index() {
668  return _cpu_brand_index;
669 }
670 
671 ////////////////////////////////////////////////////////////////////
672 // Function: DisplayInformation::get_cpu_frequency
673 // Access: Published
674 // Description:
675 ////////////////////////////////////////////////////////////////////
676 PN_uint64 DisplayInformation::
677 get_cpu_frequency() {
678  return _cpu_frequency;
679 }
680 
681 ////////////////////////////////////////////////////////////////////
682 // Function: DisplayInformation::get_cpu_time
683 // Access: Published
684 // Description:
685 ////////////////////////////////////////////////////////////////////
686 PN_uint64 DisplayInformation::
687 get_cpu_time() {
688  PN_uint64 cpu_time;
689 
690  cpu_time = 0;
691  if (_cpu_time_function) {
692  cpu_time = _cpu_time_function();
693  }
694 
695  return cpu_time;
696 }
697 
698 ////////////////////////////////////////////////////////////////////
699 // Function: DisplayInformation::get_maximum_cpu_frequency
700 // Access: Published
701 // Description:
702 ////////////////////////////////////////////////////////////////////
703 PN_uint64 DisplayInformation::
704 get_maximum_cpu_frequency() {
705  return _maximum_cpu_frequency;
706 }
707 
708 ////////////////////////////////////////////////////////////////////
709 // Function: DisplayInformation::get_current_cpu_frequency
710 // Access: Published
711 // Description:
712 ////////////////////////////////////////////////////////////////////
713 PN_uint64 DisplayInformation::
714 get_current_cpu_frequency() {
715  return _current_cpu_frequency;
716 }
717 
718 ////////////////////////////////////////////////////////////////////
719 // Function: DisplayInformation::update_cpu_frequency
720 // Access: Published
721 // Description:
722 ////////////////////////////////////////////////////////////////////
723 void DisplayInformation::
724 update_cpu_frequency(int processor_number) {
725  if (_update_cpu_frequency_function) {
726  _update_cpu_frequency_function (processor_number, this);
727  }
728 }
729 
730 ////////////////////////////////////////////////////////////////////
731 // Function: DisplayInformation::get_num_cpu_cores
732 // Access: Published
733 // Description: Returns the number of individual CPU cores in the
734 // system, or 0 if this number is not available. A
735 // hyperthreaded CPU counts once here.
736 ////////////////////////////////////////////////////////////////////
739  return _num_cpu_cores;
740 }
741 
742 ////////////////////////////////////////////////////////////////////
743 // Function: DisplayInformation::get_num_logical_cpus
744 // Access: Published
745 // Description: Returns the number of logical CPU's in the
746 // system, or 0 if this number is not available. A
747 // hyperthreaded CPU counts as two or more here.
748 ////////////////////////////////////////////////////////////////////
751  return _num_logical_cpus;
752 }
753 
754 ////////////////////////////////////////////////////////////////////
755 // Function: DisplayInformation::get_os_version_major
756 // Access: Published
757 // Description: Returns -1 if not set.
758 ////////////////////////////////////////////////////////////////////
761  return _os_version_major;
762 }
763 
764 ////////////////////////////////////////////////////////////////////
765 // Function: DisplayInformation::get_os_version_minor
766 // Access: Published
767 // Description: Returns -1 if not set.
768 ////////////////////////////////////////////////////////////////////
771  return _os_version_minor;
772 }
773 
774 ////////////////////////////////////////////////////////////////////
775 // Function: DisplayInformation::get_os_version_build
776 // Access: Published
777 // Description: Returns -1 if not set.
778 ////////////////////////////////////////////////////////////////////
781  return _os_version_build;
782 }
783 
784 ////////////////////////////////////////////////////////////////////
785 // Function: DisplayInformation::get_os_platform_id
786 // Access: Published
787 // Description: Returns -1 if not set.
788 ////////////////////////////////////////////////////////////////////
791  return _os_platform_id;
792 }
bool operator==(const DisplayMode &other) const
Returns true if these two DisplayModes are identical.
int get_num_cpu_cores()
Returns the number of individual CPU cores in the system, or 0 if this number is not available...
int get_os_version_build()
Returns -1 if not set.
bool operator!=(const DisplayMode &other) const
Returns false if these two DisplayModes are identical.
int get_os_version_major()
Returns -1 if not set.
unsigned int get_cpu_id_data(int index)
Returns part of cpu id binary data based on the index.
int get_os_platform_id()
Returns -1 if not set.
int get_cpu_id_size()
Returns the number of 32-bit values for cpu id binary data.
int get_num_logical_cpus()
Returns the number of logical CPU&#39;s in the system, or 0 if this number is not available.
int get_os_version_minor()
Returns -1 if not set.