-
Notifications
You must be signed in to change notification settings - Fork 6
/
cpuidsdk.cs
3176 lines (3062 loc) · 122 KB
/
cpuidsdk.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.Runtime.InteropServices;
public class CPUIDSDK
{
///////////////////////////////////////////////////////////////////////////
// Error codes
///////////////////////////////////////////////////////////////////////////
public const uint CPUIDSDK_ERROR_NO_ERROR = 0x00000000;
public const uint CPUIDSDK_ERROR_EVALUATION = 0x00000001;
public const uint CPUIDSDK_ERROR_DRIVER = 0x00000002;
public const uint CPUIDSDK_ERROR_VM_RUNNING = 0x00000004;
public const uint CPUIDSDK_ERROR_LOCKED = 0x00000008;
public const uint CPUIDSDK_ERROR_INVALID_DLL = 0x00000010;
public const uint CPUIDSDK_EXT_ERROR_EVAL_1 = 0x00000001;
public const uint CPUIDSDK_EXT_ERROR_EVAL_2 = 0x00000002;
///////////////////////////////////////////////////////////////////////////
// Configuration flags
///////////////////////////////////////////////////////////////////////////
public const uint CPUIDSDK_CONFIG_USE_SOFTWARE = 0x00000002;
public const uint CPUIDSDK_CONFIG_USE_DMI = 0x00000004;
public const uint CPUIDSDK_CONFIG_USE_PCI = 0x00000008;
public const uint CPUIDSDK_CONFIG_USE_ACPI = 0x00000010;
public const uint CPUIDSDK_CONFIG_USE_CHIPSET = 0x00000020;
public const uint CPUIDSDK_CONFIG_USE_SMBUS = 0x00000040;
public const uint CPUIDSDK_CONFIG_USE_SPD = 0x00000080;
public const uint CPUIDSDK_CONFIG_USE_STORAGE = 0x00000100;
public const uint CPUIDSDK_CONFIG_USE_GRAPHICS = 0x00000200;
public const uint CPUIDSDK_CONFIG_USE_HWMONITORING = 0x00000400;
public const uint CPUIDSDK_CONFIG_USE_PROCESSOR = 0x00000800;
public const uint CPUIDSDK_CONFIG_USE_DISPLAY_API = 0x00001000;
public const uint CPUIDSDK_CONFIG_USE_ACPI_TIMER = 0x00004000;
public const uint CPUIDSDK_CONFIG_CHECK_VM = 0x01000000;
public const uint CPUIDSDK_CONFIG_WAKEUP_HDD = 0x02000000;
public const uint CPUIDSDK_CONFIG_SERVER_SAFE = 0x80000000;
public const uint CPUIDSDK_CONFIG_USE_EVERYTHING = 0x7FFFFFFF;
///////////////////////////////////////////////////////////////////////////
// Constants
///////////////////////////////////////////////////////////////////////////
public static int I_UNDEFINED_VALUE = -1;
public static float F_UNDEFINED_VALUE = -1.0f;
public static uint MAX_INTEGER = 0xFFFFFFFF;
public static float MAX_FLOAT = (float)MAX_INTEGER;
public bool IS_F_DEFINED(float _f) { return (_f > 0.0f) ? true : false; }
public bool IS_F_DEFINED(double _f) { return (_f > 0.0) ? true : false; }
public bool IS_I_DEFINED(int _i) { return (_i == I_UNDEFINED_VALUE) ? false : true; }
public bool IS_I_DEFINED(uint _i) { return (_i == (uint)I_UNDEFINED_VALUE) ? false : true; }
public bool IS_I_DEFINED(short _i) { return (_i == (short)I_UNDEFINED_VALUE) ? false : true; }
public bool IS_I_DEFINED(ushort _i) { return (_i == (ushort)I_UNDEFINED_VALUE) ? false : true; }
public bool IS_I_DEFINED(sbyte _i) { return (_i == (sbyte)I_UNDEFINED_VALUE) ? false : true; }
public bool IS_I_DEFINED(byte _i) { return (_i == (byte)I_UNDEFINED_VALUE) ? false : true; }
///////////////////////////////////////////////////////////////////////////
// Devices classes
///////////////////////////////////////////////////////////////////////////
public const uint CLASS_DEVICE_UNKNOWN = 0x00000000;
public const uint CLASS_DEVICE_PCI = 0x00000001;
public const uint CLASS_DEVICE_SMBUS = 0x00000002;
public const uint CLASS_DEVICE_PROCESSOR = 0x00000004;
public const uint CLASS_DEVICE_LPCIO = 0x00000008;
public const uint CLASS_DEVICE_DRIVE = 0x00000010;
public const uint CLASS_DEVICE_DISPLAY_ADAPTER = 0x00000020;
public const uint CLASS_DEVICE_HID = 0x00000040;
public const uint CLASS_DEVICE_BATTERY = 0x00000080;
public const uint CLASS_DEVICE_EVBOT = 0x00000100;
public const uint CLASS_DEVICE_NETWORK = 0x00000200;
public const uint CLASS_DEVICE_MAINBOARD = 0x00000400;
public const uint CLASS_DEVICE_MEMORY_MODULE = 0x00000800;
public const uint CLASS_DEVICE_PSU = 0x00001000;
public const uint CLASS_DEVICE_TYPE_MASK = 0x7FFFFFFF;
public const uint CLASS_DEVICE_COMPOSITE = 0x80000000;
///////////////////////////////////////////////////////////////////////////
// CPU manufacturers, archis & models
///////////////////////////////////////////////////////////////////////////
public const uint CPU_MANUFACTURER_MASK = 0xFF000000;
public const uint CPU_FAMILY_MASK = 0xFFFFFF00;
public const uint CPU_MODEL_MASK = 0xFFFFFFFF;
// Manufacturers
public const uint CPU_UNKNOWN = 0x0;
public const uint CPU_INTEL = 0x1000000;
public const uint CPU_AMD = 0x2000000;
public const uint CPU_CYRIX = 0x4000000;
public const uint CPU_VIA = 0x8000000;
public const uint CPU_TRANSMETA = 0x10000000;
// Intel families
public const uint CPU_INTEL_386 = CPU_INTEL + 0x100;
public const uint CPU_INTEL_486 = CPU_INTEL + 0x200;
public const uint CPU_INTEL_P5 = CPU_INTEL + 0x400;
public const uint CPU_INTEL_P6 = CPU_INTEL + 0x800;
public const uint CPU_INTEL_NETBURST = CPU_INTEL + 0x1000;
public const uint CPU_INTEL_MOBILE = CPU_INTEL + 0x2000;
public const uint CPU_INTEL_CORE = CPU_INTEL + 0x4000;
public const uint CPU_INTEL_CORE_2 = CPU_INTEL + 0x8000;
public const uint CPU_INTEL_BONNELL = CPU_INTEL + 0x010000;
public const uint CPU_INTEL_SALTWELL = CPU_INTEL + 0x010100;
public const uint CPU_INTEL_SILVERMONT = CPU_INTEL + 0x010200;
public const uint CPU_INTEL_AIRMONT = CPU_INTEL + 0x010400;
public const uint CPU_INTEL_NEHALEM = CPU_INTEL + 0x20000;
public const uint CPU_INTEL_SANDY_BRIDGE = CPU_INTEL + 0x020100;
public const uint CPU_INTEL_HASWELL = CPU_INTEL + 0x020200;
public const uint CPU_INTEL_SKYLAKE = CPU_INTEL + 0x040000;
public const uint CPU_INTEL_ITANIUM = CPU_INTEL + 0x100000;
public const uint CPU_INTEL_ITANIUM_2 = CPU_INTEL + 0x100100;
public const uint CPU_INTEL_MIC = CPU_INTEL + 0x200000;
// Intel models
// P5
public const uint CPU_PENTIUM = CPU_INTEL_P5 + 0x1;
public const uint CPU_PENTIUM_MMX = CPU_INTEL_P5 + 0x2;
// P6
public const uint CPU_PENTIUM_PRO = CPU_INTEL_P6 + 0x1;
public const uint CPU_PENTIUM_2 = CPU_INTEL_P6 + 0x2;
public const uint CPU_PENTIUM_2_M = CPU_INTEL_P6 + 0x3;
public const uint CPU_CELERON_P2 = CPU_INTEL_P6 + 0x4;
public const uint CPU_XEON_P2 = CPU_INTEL_P6 + 0x5;
public const uint CPU_PENTIUM_3 = CPU_INTEL_P6 + 0x6;
public const uint CPU_PENTIUM_3_M = CPU_INTEL_P6 + 0x7;
public const uint CPU_PENTIUM_3_S = CPU_INTEL_P6 + 0x8;
public const uint CPU_CELERON_P3 = CPU_INTEL_P6 + 0x9;
public const uint CPU_XEON_P3 = CPU_INTEL_P6 + 0xA;
// Netburst
public const uint CPU_PENTIUM_4 = CPU_INTEL_NETBURST + 0x1;
public const uint CPU_PENTIUM_4_M = CPU_INTEL_NETBURST + 0x2;
public const uint CPU_PENTIUM_4_HT = CPU_INTEL_NETBURST + 0x3;
public const uint CPU_PENTIUM_4_EE = CPU_INTEL_NETBURST + 0x4;
public const uint CPU_CELERON_P4 = CPU_INTEL_NETBURST + 0x5;
public const uint CPU_CELERON_D = CPU_INTEL_NETBURST + 0x6;
public const uint CPU_XEON_P4 = CPU_INTEL_NETBURST + 0x7;
public const uint CPU_PENTIUM_D = CPU_INTEL_NETBURST + 0x8;
public const uint CPU_PENTIUM_XE = CPU_INTEL_NETBURST + 0x9;
// Mobile
public const uint CPU_PENTIUM_M = CPU_INTEL_MOBILE + 0x1;
public const uint CPU_CELERON_M = CPU_INTEL_MOBILE + 0x2;
// Core 1
public const uint CPU_CORE_SOLO = CPU_INTEL_CORE + 0x1;
public const uint CPU_CORE_DUO = CPU_INTEL_CORE + 0x2;
public const uint CPU_CORE_CELERON_M = CPU_INTEL_CORE + 0x3;
public const uint CPU_CORE_CELERON = CPU_INTEL_CORE + 0x4;
// Core 2
public const uint CPU_CORE_2_DUO = CPU_INTEL_CORE_2 + 0x1;
public const uint CPU_CORE_2_EE = CPU_INTEL_CORE_2 + 0x2;
public const uint CPU_CORE_2_XEON = CPU_INTEL_CORE_2 + 0x3;
public const uint CPU_CORE_2_CELERON = CPU_INTEL_CORE_2 + 0x4;
public const uint CPU_CORE_2_QUAD = CPU_INTEL_CORE_2 + 0x5;
public const uint CPU_CORE_2_PENTIUM = CPU_INTEL_CORE_2 + 0x6;
public const uint CPU_CORE_2_CELERON_DC = CPU_INTEL_CORE_2 + 0x7;
public const uint CPU_CORE_2_SOLO = CPU_INTEL_CORE_2 + 0x8;
// Bonnell
public const uint CPU_BONNELL_ATOM = CPU_INTEL_BONNELL + 0x01;
// Saltwell
public const uint CPU_SALTWELL_ATOM = CPU_INTEL_SALTWELL + 0x01;
// Silvermont
public const uint CPU_SILVERMONT_ATOM = CPU_INTEL_SILVERMONT + 0x01;
public const uint CPU_SILVERMONT_CELERON = CPU_INTEL_SILVERMONT + 0x02;
public const uint CPU_SILVERMONT_PENTIUM = CPU_INTEL_SILVERMONT + 0x03;
public const uint CPU_SILVERMONT_ATOM_X7 = CPU_INTEL_SILVERMONT + 0x04;
public const uint CPU_SILVERMONT_ATOM_X5 = CPU_INTEL_SILVERMONT + 0x05;
public const uint CPU_SILVERMONT_ATOM_X3 = CPU_INTEL_SILVERMONT + 0x06;
// Nehalem
public const uint CPU_NEHALEM_CORE_I7 = CPU_INTEL_NEHALEM + 0x1;
public const uint CPU_NEHALEM_CORE_I7E = CPU_INTEL_NEHALEM + 0x2;
public const uint CPU_NEHALEM_XEON = CPU_INTEL_NEHALEM + 0x3;
public const uint CPU_NEHALEM_CORE_I3 = CPU_INTEL_NEHALEM + 0x4;
public const uint CPU_NEHALEM_CORE_I5 = CPU_INTEL_NEHALEM + 0x5;
public const uint CPU_NEHALEM_PENTIUM = CPU_INTEL_NEHALEM + 0x7;
public const uint CPU_NEHALEM_CELERON = CPU_INTEL_NEHALEM + 0x8;
// Sandybridge
public const uint CPU_SANDY_BRIDGE_CORE_I7 = CPU_INTEL_SANDY_BRIDGE + 0x01;
public const uint CPU_SANDY_BRIDGE_CORE_I7E = CPU_INTEL_SANDY_BRIDGE + 0x02;
public const uint CPU_SANDY_BRIDGE_XEON = CPU_INTEL_SANDY_BRIDGE + 0x03;
public const uint CPU_SANDY_BRIDGE_CORE_I3 = CPU_INTEL_SANDY_BRIDGE + 0x04;
public const uint CPU_SANDY_BRIDGE_CORE_I5 = CPU_INTEL_SANDY_BRIDGE + 0x05;
public const uint CPU_SANDY_BRIDGE_PENTIUM = CPU_INTEL_SANDY_BRIDGE + 0x07;
public const uint CPU_SANDY_BRIDGE_CELERON = CPU_INTEL_SANDY_BRIDGE + 0x08;
// Haswell
public const uint CPU_HASWELL_CORE_I7 = CPU_INTEL_HASWELL + 0x01;
public const uint CPU_HASWELL_CORE_I7E = CPU_INTEL_HASWELL + 0x02;
public const uint CPU_HASWELL_XEON = CPU_INTEL_HASWELL + 0x03;
public const uint CPU_HASWELL_CORE_I3 = CPU_INTEL_HASWELL + 0x04;
public const uint CPU_HASWELL_CORE_I5 = CPU_INTEL_HASWELL + 0x05;
public const uint CPU_HASWELL_PENTIUM = CPU_INTEL_HASWELL + 0x07;
public const uint CPU_HASWELL_CELERON = CPU_INTEL_HASWELL + 0x08;
public const uint CPU_HASWELL_CORE_M = CPU_INTEL_HASWELL + 0x09;
// Skylake
public const uint CPU_SKYLAKE_XEON = CPU_INTEL_SKYLAKE + 0x01;
public const uint CPU_SKYLAKE_CORE_I7 = CPU_INTEL_SKYLAKE + 0x02;
public const uint CPU_SKYLAKE_CORE_I5 = CPU_INTEL_SKYLAKE + 0x03;
public const uint CPU_SKYLAKE_CORE_I3 = CPU_INTEL_SKYLAKE + 0x04;
public const uint CPU_SKYLAKE_PENTIUM = CPU_INTEL_SKYLAKE + 0x05;
public const uint CPU_SKYLAKE_CELERON = CPU_INTEL_SKYLAKE + 0x06;
public const uint CPU_SKYLAKE_CORE_M7 = CPU_INTEL_SKYLAKE + 0x07;
public const uint CPU_SKYLAKE_CORE_M5 = CPU_INTEL_SKYLAKE + 0x08;
public const uint CPU_SKYLAKE_CORE_M3 = CPU_INTEL_SKYLAKE + 0x09;
// AMD families
public const uint CPU_AMD_386 = CPU_AMD + 0x000100;
public const uint CPU_AMD_486 = CPU_AMD + 0x000200;
public const uint CPU_AMD_K5 = CPU_AMD + 0x000400;
public const uint CPU_AMD_K6 = CPU_AMD + 0x000800;
public const uint CPU_AMD_K7 = CPU_AMD + 0x001000;
public const uint CPU_AMD_K8 = CPU_AMD + 0x002000;
public const uint CPU_AMD_K10 = CPU_AMD + 0x004000;
public const uint CPU_AMD_K12 = CPU_AMD + 0x010000;
public const uint CPU_AMD_K14 = CPU_AMD + 0x020000;
public const uint CPU_AMD_K15 = CPU_AMD + 0x040000;
public const uint CPU_AMD_K16 = CPU_AMD + 0x080000;
public const uint CPU_AMD_K17 = CPU_AMD + 0x100000;
// AMD models
// K5
public const uint CPU_K5 = CPU_AMD_K5 + 0x01;
public const uint CPU_K5_GEODE = CPU_AMD_K5 + 0x02;
// K6
public const uint CPU_K6 = CPU_AMD_K6 + 0x01;
public const uint CPU_K6_2 = CPU_AMD_K6 + 0x02;
public const uint CPU_K6_3 = CPU_AMD_K6 + 0x03;
// K7
public const uint CPU_K7_ATHLON = CPU_AMD_K7 + 0x01;
public const uint CPU_K7_ATHLON_XP = CPU_AMD_K7 + 0x02;
public const uint CPU_K7_ATHLON_MP = CPU_AMD_K7 + 0x03;
public const uint CPU_K7_DURON = CPU_AMD_K7 + 0x04;
public const uint CPU_K7_SEMPRON = CPU_AMD_K7 + 0x05;
public const uint CPU_K7_SEMPRON_M = CPU_AMD_K7 + 0x06;
// K8
public const uint CPU_K8_ATHLON_64 = CPU_AMD_K8 + 0x01;
public const uint CPU_K8_ATHLON_64_M = CPU_AMD_K8 + 0x02;
public const uint CPU_K8_ATHLON_64_FX = CPU_AMD_K8 + 0x03;
public const uint CPU_K8_OPTERON = CPU_AMD_K8 + 0x04;
public const uint CPU_K8_TURION_64 = CPU_AMD_K8 + 0x05;
public const uint CPU_K8_SEMPRON = CPU_AMD_K8 + 0x06;
public const uint CPU_K8_SEMPRON_M = CPU_AMD_K8 + 0x07;
public const uint CPU_K8_ATHLON_64_X2 = CPU_AMD_K8 + 0x08;
public const uint CPU_K8_TURION_64_X2 = CPU_AMD_K8 + 0x09;
public const uint CPU_K8_ATHLON_NEO = CPU_AMD_K8 + 0x0A;
// K10
public const uint CPU_K10_PHENOM = CPU_AMD_K10 + 0x01;
public const uint CPU_K10_PHENOM_X3 = CPU_AMD_K10 + 0x02;
public const uint CPU_K10_PHENOM_FX = CPU_AMD_K10 + 0x03;
public const uint CPU_K10_OPTERON = CPU_AMD_K10 + 0x04;
public const uint CPU_K10_TURION_64 = CPU_AMD_K10 + 0x05;
public const uint CPU_K10_TURION_64_ULTRA = CPU_AMD_K10 + 0x06;
public const uint CPU_K10_ATHLON_64 = CPU_AMD_K10 + 0x07;
public const uint CPU_K10_SEMPRON = CPU_AMD_K10 + 0x08;
public const uint CPU_K10_ATHLON_2 = CPU_AMD_K10 + 0x11;
public const uint CPU_K10_ATHLON_2_X2 = CPU_AMD_K10 + 0x0B;
public const uint CPU_K10_ATHLON_2_X3 = CPU_AMD_K10 + 0x0D;
public const uint CPU_K10_ATHLON_2_X4 = CPU_AMD_K10 + 0x0C;
public const uint CPU_K10_PHENOM_II = CPU_AMD_K10 + 0x09;
public const uint CPU_K10_PHENOM_II_X2 = CPU_AMD_K10 + 0x0A;
public const uint CPU_K10_PHENOM_II_X3 = CPU_AMD_K10 + 0x0E;
public const uint CPU_K10_PHENOM_II_X4 = CPU_AMD_K10 + 0x0F;
public const uint CPU_K10_PHENOM_II_X6 = CPU_AMD_K10 + 0x10;
// K15
public const uint CPU_K15_FXB = CPU_AMD_K15 + 0x01;
public const uint CPU_K15_OPTERON = CPU_AMD_K15 + 0x02;
public const uint CPU_K15_A10T = CPU_AMD_K15 + 0x03;
public const uint CPU_K15_A8T = CPU_AMD_K15 + 0x04;
public const uint CPU_K15_A6T = CPU_AMD_K15 + 0x05;
public const uint CPU_K15_A4T = CPU_AMD_K15 + 0x06;
public const uint CPU_K15_ATHLON_X4 = CPU_AMD_K15 + 0x07;
public const uint CPU_K15_FXV = CPU_AMD_K15 + 0x08;
public const uint CPU_K15_A10R = CPU_AMD_K15 + 0x09;
public const uint CPU_K15_A8R = CPU_AMD_K15 + 0x0A;
public const uint CPU_K15_A6R = CPU_AMD_K15 + 0x0B;
public const uint CPU_K15_A4R = CPU_AMD_K15 + 0x0C;
public const uint CPU_K15_SEMPRON = CPU_AMD_K15 + 0x0D;
public const uint CPU_K15_ATHLON_X2 = CPU_AMD_K15 + 0x0E;
public const uint CPU_K15_FXC = CPU_AMD_K15 + 0x0F;
public const uint CPU_K15_A10C = CPU_AMD_K15 + 0x10;
public const uint CPU_K15_A8C = CPU_AMD_K15 + 0x11;
public const uint CPU_K15_A6C = CPU_AMD_K15 + 0x12;
public const uint CPU_K15_A4C = CPU_AMD_K15 + 0x13;
public const uint CPU_K15_A12 = CPU_AMD_K15 + 0x14;
// K16
public const uint CPU_K16_A6 = CPU_AMD_K16 + 0x01;
public const uint CPU_K16_A4 = CPU_AMD_K16 + 0x02;
public const uint CPU_K16_OPTERON = CPU_AMD_K16 + 0x05;
public const uint CPU_K16_ATHLON = CPU_AMD_K16 + 0x06;
public const uint CPU_K16_SEMPRON = CPU_AMD_K16 + 0x07;
public const uint CPU_K16_E1 = CPU_AMD_K16 + 0x08;
public const uint CPU_K16_E2 = CPU_AMD_K16 + 0x09;
public const uint CPU_K16_A8 = CPU_AMD_K16 + 0x0A;
public const uint CPU_K16_A10 = CPU_AMD_K16 + 0x0B;
// VIA families
public const uint CPU_VIA_WINCHIP = CPU_VIA + 0x000400;
public const uint CPU_VIA_C3 = CPU_VIA + 0x000800;
public const uint CPU_VIA_C7 = CPU_VIA + 0x001000;
public const uint CPU_VIA_NANO = CPU_VIA + 0x002000;
// VIA models
// C3
public const uint CPU_C3 = CPU_VIA_C3 + 0x01;
// C7
public const uint CPU_C7 = CPU_VIA_C7 + 0x01;
public const uint CPU_C7_M = CPU_VIA_C7 + 0x02;
public const uint CPU_EDEN = CPU_VIA_C7 + 0x03;
public const uint CPU_C7_D = CPU_VIA_C7 + 0x04;
// Nano
public const uint CPU_NANO_X2 = CPU_VIA_NANO + 0x01;
public const uint CPU_EDEN_X2 = CPU_VIA_NANO + 0x02;
public const uint CPU_NANO_X3 = CPU_VIA_NANO + 0x03;
public const uint CPU_EDEN_X4 = CPU_VIA_NANO + 0x04;
public const uint CPU_QUADCORE = CPU_VIA_NANO + 0x05;
// Cyrix
public const uint CPU_CYRIX_6X86 = CPU_CYRIX + 0x02;
// Transmeta
public const uint CPU_CRUSOE = CPU_TRANSMETA + 0x01;
public const uint CPU_EFFICEON = CPU_TRANSMETA + 0x02;
///////////////////////////////////////////////////////////////////////////
// Cache descriptors
///////////////////////////////////////////////////////////////////////////
public const int CACHE_TYPE_DATA = 0x1; // Data cache
public const int CACHE_TYPE_INSTRUCTION = 0x2; // Instruction cache
public const int CACHE_TYPE_UNIFIED = 0x3; // Unified cache
public const int CACHE_TYPE_TRACE_CACHE = 0x4; // Trace cache
///////////////////////////////////////////////////////////////////////////
// Instructions sets
///////////////////////////////////////////////////////////////////////////
public const int ISET_MMX = 0x01;
public const int ISET_EXTENDED_MMX = 0x02;
public const int ISET_3DNOW = 0x03;
public const int ISET_EXTENDED_3DNOW = 0x04;
public const int ISET_SSE = 0x05;
public const int ISET_SSE2 = 0x06;
public const int ISET_SSE3 = 0x07;
public const int ISET_SSSE3 = 0x08;
public const int ISET_SSE4_1 = 0x09;
public const int ISET_SSE4_2 = 0x0C;
public const int ISET_SSE4A = 0x0D;
public const int ISET_XOP = 0x0E;
public const int ISET_X86_64 = 0x10;
public const int ISET_NX = 0x11;
public const int ISET_VMX = 0x12;
public const int ISET_AES = 0x13;
public const int ISET_AVX = 0x14;
public const int ISET_AVX2 = 0x15;
public const int ISET_FMA3 = 0x16;
public const int ISET_FMA4 = 0x17;
public const int ISET_RTM = 0x18;
public const int ISET_HLE = 0x19;
public const int ISET_AVX512F = 0x1A;
///////////////////////////////////////////////////////////////////////////
// Monitoring
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// Hardware Monitor IDs
///////////////////////////////////////////////////////////////////////////
public const int HWM_CLASS_LPC = 0x00000001;
public const int HWM_CLASS_CPU = 0x00000002;
public const int HWM_CLASS_HDD = 0x00000004;
public const int HWM_CLASS_DISPLAYADAPTER = 0x00000008;
public const int HWM_CLASS_PSU = 0x00000010;
public const int HWM_CLASS_ACPI = 0x00000020;
public const int HWM_CLASS_RAM = 0x00000040;
public const int HWM_CLASS_CHASSIS = 0x00000080;
public const int HWM_CLASS_WATERCOOLER = 0x00000100;
public const int HWM_CLASS_BATTERY = 0x00000200;
///////////////////////////////////////////////////////////////////////////
// Sensors classes & predefined types
///////////////////////////////////////////////////////////////////////////
public const int SENSOR_CLASS_VOLTAGE = 0x100;
public const int SENSOR_CLASS_TEMPERATURE = 0x200;
public const int SENSOR_CLASS_FAN = 0x400;
public const int SENSOR_CLASS_CURRENT = 0x800;
public const int SENSOR_CLASS_POWER = 0x1000;
public const int SENSOR_CLASS_FAN_PWM = 0x2000;
public const int SENSOR_CLASS_PUMP_PWM = 0x4000;
public const int SENSOR_CLASS_WATER_LEVEL = 0x8000;
public const int SENSOR_CLASS_POSITION = 0x10000;
public const int SENSOR_CLASS_CAPACITY = 0x20000;
public const int SENSOR_CLASS_CASEOPEN = 0x40000;
public const int SENSOR_CLASS_LEVEL = 0x80000;
public const int SENSOR_CLASS_COUNTER = 0x100000;
public const int SENSOR_CLASS_UTILIZATION = 0x200000;
public const int SENSOR_CLASS_CLOCK_SPEED = 0x400000;
public const int SENSOR_VOLTAGE_VCORE = 0x1000000 + SENSOR_CLASS_VOLTAGE;
public const int SENSOR_VOLTAGE_3V3 = 0x2000000 + SENSOR_CLASS_VOLTAGE; // +3.3V
public const int SENSOR_VOLTAGE_P5V = 0x3000000 + SENSOR_CLASS_VOLTAGE; // +5V
public const int SENSOR_VOLTAGE_P12V = 0x4000000 + SENSOR_CLASS_VOLTAGE; // +12V
public const int SENSOR_VOLTAGE_M5V = 0x5000000 + SENSOR_CLASS_VOLTAGE; // -5V
public const int SENSOR_VOLTAGE_M12V = 0x6000000 + SENSOR_CLASS_VOLTAGE; // -12V
public const int SENSOR_VOLTAGE_5VSB = 0x7000000 + SENSOR_CLASS_VOLTAGE; // +5V standby
public const int SENSOR_VOLTAGE_DRAM = 0x8000000 + SENSOR_CLASS_VOLTAGE;
public const int SENSOR_TEMPERATURE_CPU = 0x1000000 + SENSOR_CLASS_TEMPERATURE;
public const int SENSOR_FAN_CPU = 0x1000000 + SENSOR_CLASS_FAN;
public const int SENSOR_MODE_AUTO = 0x1;
public const int SENSOR_MODE_MANUAL = 0x2;
///////////////////////////////////////////////////////////////////////////
// Memory types
///////////////////////////////////////////////////////////////////////////
public const int MEMORY_TYPE_SPM_RAM = 0x1;
public const int MEMORY_TYPE_RDRAM = 0x2;
public const int MEMORY_TYPE_EDO_RAM = 0x3;
public const int MEMORY_TYPE_FPM_RAM = 0x4;
public const int MEMORY_TYPE_SDRAM = 0x5;
public const int MEMORY_TYPE_DDR_SDRAM = 0x6;
public const int MEMORY_TYPE_DDR2_SDRAM = 0x7;
public const int MEMORY_TYPE_DDR2_SDRAM_FB = 0x8;
public const int MEMORY_TYPE_DDR3_SDRAM = 0x9;
public const int MEMORY_TYPE_DDR4_SDRAM = 0xA;
///////////////////////////////////////////////////////////////////////////
// Display Adapter infos source
///////////////////////////////////////////////////////////////////////////
public const int DISPLAY_CLOCK_DOMAIN_GRAPHICS = 0x0;
public const int DISPLAY_CLOCK_DOMAIN_MEMORY = 0x4;
public const int DISPLAY_CLOCK_DOMAIN_PROCESSOR = 0x7;
public const int MEMORY_TYPE_SDR = 1;
public const int MEMORY_TYPE_DDR = 2;
public const int MEMORY_TYPE_LPDDR2 = 9;
public const int MEMORY_TYPE_DDR2 = 3;
public const int MEMORY_TYPE_DDR3 = 7;
public const int MEMORY_TYPE_GDDR2 = 4;
public const int MEMORY_TYPE_GDDR3 = 5;
public const int MEMORY_TYPE_GDDR4 = 6;
public const int MEMORY_TYPE_GDDR5 = 8;
public const int MEMORY_TYPE_GDDR5X = 10;
public const int MEMORY_TYPE_HBM2 = 11;
///////////////////////////////////////////////////////////////////////////
// DLL name & path
///////////////////////////////////////////////////////////////////////////
#if _X64_
#if DEBUG
public const string szDllPath = "..\\..\\..\\..\\..\\..\\bin\\";
#else
public const string szDllPath = "";
#endif
public const string szDllFilename = "cpuidsdk64.dll";
#else // _X64_
#if DEBUG
public const string szDllPath = "..\\..\\..\\..\\..\\bin\\";
#else
public const string szDllPath = "";
#endif
public const string szDllFilename = "cpuidsdk.dll";
#endif // _X64_
protected const string szDllName = szDllPath + szDllFilename;
///////////////////////////////////////////////////////////////////////////
// DLL functions
///////////////////////////////////////////////////////////////////////////
[DllImport(szDllName, EntryPoint = "QueryInterface")]
protected static extern IntPtr CPUIDSDK_fp_QueryInterface(uint _code);
// Instance management
private delegate IntPtr CPUIDSDK_fp_CreateInstance();
private delegate void CPUIDSDK_fp_DestroyInstance(IntPtr objptr);
private delegate int CPUIDSDK_fp_Init(IntPtr objptr, string _szDllPath, string _szDllFilename, int _config_flag, ref int _errorcode, ref int _extended_errorcode);
private delegate void CPUIDSDK_fp_Close(IntPtr objptr);
private delegate void CPUIDSDK_fp_RefreshInformation(IntPtr objptr);
private delegate void CPUIDSDK_fp_GetDllVersion(IntPtr objptr, ref int _version);
// CPU
private delegate int CPUIDSDK_fp_GetNbProcessors(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetProcessorFamily(IntPtr objptr, int _proc_index);
private delegate int CPUIDSDK_fp_GetProcessorCoreCount(IntPtr objptr, int _proc_index);
private delegate int CPUIDSDK_fp_GetProcessorThreadCount(IntPtr objptr, int _proc_index);
private delegate int CPUIDSDK_fp_GetProcessorCoreThreadCount(IntPtr objptr, int _proc_index, int _core_index);
private delegate int CPUIDSDK_fp_GetProcessorThreadAPICID(IntPtr objptr, int _proc_index, int _core_index, int _thread_index);
private delegate IntPtr CPUIDSDK_fp_GetProcessorName(IntPtr objptr, int _proc_index);
private delegate IntPtr CPUIDSDK_fp_GetProcessorCodeName(IntPtr objptr, int _proc_index);
private delegate IntPtr CPUIDSDK_fp_GetProcessorSpecification(IntPtr objptr, int _proc_index);
private delegate IntPtr CPUIDSDK_fp_GetProcessorPackage(IntPtr objptr, int _proc_index);
private delegate IntPtr CPUIDSDK_fp_GetProcessorStepping(IntPtr objptr, int _proc_index);
private delegate float CPUIDSDK_fp_GetProcessorTDP(IntPtr objptr, int _proc_index);
private delegate float CPUIDSDK_fp_GetProcessorManufacturingProcess(IntPtr objptr, int _proc_index);
private delegate int CPUIDSDK_fp_IsProcessorInstructionSetAvailable(IntPtr objptr, int _proc_index, int _iset);
private delegate float CPUIDSDK_fp_GetProcessorCoreClockFrequency(IntPtr objptr, int _proc_index, int _core_index);
private delegate float CPUIDSDK_fp_GetProcessorCoreClockMultiplier(IntPtr objptr, int _proc_index, int _core_index);
private delegate float CPUIDSDK_fp_GetProcessorCoreTemperature(IntPtr objptr, int _proc_index, int _core_index);
private delegate float CPUIDSDK_fp_GetBusFrequency(IntPtr objptr);
private delegate float CPUIDSDK_fp_GetProcessorRatedBusFrequency(IntPtr objptr, int _proc_index);
private delegate int CPUIDSDK_fp_GetProcessorStockClockFrequency(IntPtr objptr, int _proc_index);
private delegate int CPUIDSDK_fp_GetProcessorStockBusFrequency(IntPtr objptr, int _proc_index);
private delegate int CPUIDSDK_fp_GetProcessorMaxCacheLevel(IntPtr objptr, int _proc_index);
private delegate void CPUIDSDK_fp_GetProcessorCacheParameters(IntPtr objptr, int _proc_index, int _cache_level, int _cache_type, ref int _NbCaches, ref int _size);
private delegate int CPUIDSDK_fp_GetProcessorID(IntPtr objptr, int _proc_index);
private delegate float CPUIDSDK_fp_GetProcessorVoltageID(IntPtr objptr, int _proc_index);
// Memory
private delegate int CPUIDSDK_fp_GetMemoryType(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetMemorySize(IntPtr objptr);
private delegate float CPUIDSDK_fp_GetMemoryClockFrequency(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetMemoryNumberOfChannels(IntPtr objptr);
private delegate float CPUIDSDK_fp_GetMemoryCASLatency(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetMemoryRAStoCASDelay(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetMemoryRASPrecharge(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetMemoryTRAS(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetMemoryTRC(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetMemoryCommandRate(IntPtr objptr);
// NB & BIOS
private delegate IntPtr CPUIDSDK_fp_GetNorthBridgeVendor(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetNorthBridgeModel(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetNorthBridgeRevision(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetSouthBridgeVendor(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetSouthBridgeModel(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetSouthBridgeRevision(IntPtr objptr);
private delegate void CPUIDSDK_fp_GetGraphicBusLinkParameters(IntPtr objptr, ref int _bus_type, ref int _link_width);
private delegate void CPUIDSDK_fp_GetMemorySlotsConfig(IntPtr objptr, ref int _nbslots, ref int _nbusedslots, ref int _slotmap, ref int _maxmodulesize);
private delegate IntPtr CPUIDSDK_fp_GetBIOSVendor(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetBIOSVersion(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetBIOSDate(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetMainboardVendor(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetMainboardModel(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetMainboardRevision(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetMainboardSerialNumber(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetSystemManufacturer(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetSystemProductName(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetSystemVersion(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetSystemSerialNumber(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetSystemUUID(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetChassisManufacturer(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetChassisType(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetChassisSerialNumber(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetMemoryInfosExt(IntPtr objptr, ref IntPtr _szLocation, ref IntPtr _szUsage, ref IntPtr _szCorrection);
private delegate int CPUIDSDK_fp_GetNumberOfMemoryDevices(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetMemoryDeviceInfos(IntPtr objptr, int _device_index, ref int _size, ref IntPtr _szFormat);
private delegate int CPUIDSDK_fp_GetMemoryDeviceInfosExt(IntPtr objptr, int _device_index, ref IntPtr _szDesignation, ref IntPtr _szType, ref int _total_width, ref int _data_width, ref int _speed);
// SPD
private delegate int CPUIDSDK_fp_GetNumberOfSPDModules(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetSPDModuleType(IntPtr objptr, int _spd_index);
private delegate int CPUIDSDK_fp_GetSPDModuleSize(IntPtr objptr, int _spd_index);
private delegate IntPtr CPUIDSDK_fp_GetSPDModuleFormat(IntPtr objptr, int _spd_index);
private delegate IntPtr CPUIDSDK_fp_GetSPDModuleManufacturer(IntPtr objptr, int _spd_index);
private delegate int CPUIDSDK_fp_GetSPDModuleManufacturerID(IntPtr objptr, int _spd_index, byte[] _id);
private delegate int CPUIDSDK_fp_GetSPDModuleMaxFrequency(IntPtr objptr, int _spd_index);
private delegate IntPtr CPUIDSDK_fp_GetSPDModuleSpecification(IntPtr objptr, int _spd_index);
private delegate IntPtr CPUIDSDK_fp_GetSPDModulePartNumber(IntPtr objptr, int _spd_index);
private delegate IntPtr CPUIDSDK_fp_GetSPDModuleSerialNumber(IntPtr objptr, int _spd_index);
private delegate float CPUIDSDK_fp_GetSPDModuleMinTRCD(IntPtr objptr, int _spd_index);
private delegate float CPUIDSDK_fp_GetSPDModuleMinTRP(IntPtr objptr, int _spd_index);
private delegate float CPUIDSDK_fp_GetSPDModuleMinTRAS(IntPtr objptr, int _spd_index);
private delegate float CPUIDSDK_fp_GetSPDModuleMinTRC(IntPtr objptr, int _spd_index);
private delegate int CPUIDSDK_fp_GetSPDModuleManufacturingDate(IntPtr objptr, int _spd_index, ref int _year, ref int _week);
private delegate int CPUIDSDK_fp_GetSPDModuleNumberOfBanks(IntPtr objptr, int _spd_index);
private delegate int CPUIDSDK_fp_GetSPDModuleDataWidth(IntPtr objptr, int _spd_index);
private delegate int CPUIDSDK_fp_GetSPDModuleNumberOfProfiles(IntPtr objptr, int _spd_index);
private delegate void CPUIDSDK_fp_GetSPDModuleProfileInfos(IntPtr objptr, int _spd_index, int _profile_index, ref float _frequency, ref float _tCL, ref float _nominal_vdd);
private delegate int CPUIDSDK_fp_GetSPDModuleNumberOfEPPProfiles(IntPtr objptr, int _spd_index, ref int _epp_revision);
private delegate void CPUIDSDK_fp_GetSPDModuleEPPProfileInfos(IntPtr objptr, int _spd_index, int _profile_index, ref float _frequency, ref float _tCL, ref float _tRCD, ref float _tRAS, ref float _tRP, ref float _tRC, ref float _nominal_vdd);
private delegate int CPUIDSDK_fp_GetSPDModuleNumberOfXMPProfiles(IntPtr objptr, int _spd_index, ref int _xmp_revision);
private delegate int CPUIDSDK_fp_GetSPDModuleXMPProfileNumberOfCL(IntPtr objptr, int _spd_index, int _profile_index);
private delegate void CPUIDSDK_fp_GetSPDModuleXMPProfileCLInfos(IntPtr objptr, int _spd_index, int _profile_index, int _cl_index, ref float _frequency, ref float _CL);
private delegate void CPUIDSDK_fp_GetSPDModuleXMPProfileInfos(IntPtr objptr, int _spd_index, int _profile_index, ref float _tRCD, ref float _tRAS, ref float _tRP, ref float _nominal_vdd, ref int _max_freq, ref float _max_CL);
private delegate int CPUIDSDK_fp_GetSPDModuleNumberOfAMPProfiles(IntPtr objptr, int _spd_index, ref int _amp_revision);
private delegate void CPUIDSDK_fp_GetSPDModuleAMPProfileInfos(IntPtr objptr, int _spd_index, int _profile_index, ref int _frequency, ref float _min_cycle_time, ref float _tCL, ref float _tRCD, ref float _tRAS, ref float _tRP, ref float _tRC);
private delegate int CPUIDSDK_fp_GetSPDModuleRawData(IntPtr objptr, int _spd_index, int _offset);
// Monitoring
private delegate int CPUIDSDK_fp_GetNumberOfDevices(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetDeviceClass(IntPtr objptr, int _device_index);
private delegate IntPtr CPUIDSDK_fp_GetDeviceName(IntPtr objptr, int _device_index);
private delegate int CPUIDSDK_fp_GetNumberOfSensors(IntPtr objptr, int _device_index, int _sensor_class);
private delegate int CPUIDSDK_fp_GetSensorInfos(IntPtr objptr, int _device_index, int _sensor_index, int _sensor_class, ref int _sensor_id, ref IntPtr _szNamePtr, ref int _raw_value, ref float _value, ref float _min_value, ref float _max_value);
private delegate void CPUIDSDK_fp_SensorClearMinMax(IntPtr objptr, int _device_index, int _sensor_index, int _sensor_class);
private delegate float CPUIDSDK_fp_GetSensorTypeValue(IntPtr objptr, int _sensor_type, ref int _device_index, ref int _sensor_index);
// Display
private delegate int CPUIDSDK_fp_GetNumberOfDisplayAdapter(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetDisplayAdapterID(IntPtr objptr, int _adapter_index);
private delegate IntPtr CPUIDSDK_fp_GetDisplayAdapterName(IntPtr objptr, int _adapter_index);
private delegate IntPtr CPUIDSDK_fp_GetDisplayAdapterCodeName(IntPtr objptr, int _adapter_index);
private delegate int CPUIDSDK_fp_GetDisplayAdapterNumberOfPerformanceLevels(IntPtr objptr, int _adapter_index);
private delegate int CPUIDSDK_fp_GetDisplayAdapterCurrentPerformanceLevel(IntPtr objptr, int _adapter_index);
private delegate IntPtr CPUIDSDK_fp_GetDisplayAdapterPerformanceLevelName(IntPtr objptr, int _adapter_index, int _perf_level);
private delegate float CPUIDSDK_fp_GetDisplayAdapterClock(IntPtr objptr, int _perf_level, int _adapter_index, int _domain);
private delegate float CPUIDSDK_fp_GetDisplayAdapterStockClock(IntPtr objptr, int _perf_level, int _adapter_index, int _domain);
private delegate float CPUIDSDK_fp_GetDisplayAdapterTemperature(IntPtr objptr, int _adapter_index, int _domain);
private delegate int CPUIDSDK_fp_GetDisplayAdapterFanSpeed(IntPtr objptr, int _adapter_index);
private delegate int CPUIDSDK_fp_GetDisplayAdapterFanPWM(IntPtr objptr, int _adapter_index);
private delegate int CPUIDSDK_fp_GetDisplayAdapterMemoryType(IntPtr objptr, int _adapter_index, ref int _type);
private delegate int CPUIDSDK_fp_GetDisplayAdapterMemorySize(IntPtr objptr, int _adapter_index, ref int _size);
private delegate int CPUIDSDK_fp_GetDisplayAdapterMemoryBusWidth(IntPtr objptr, int _adapter_index, ref int _bus_width);
private delegate IntPtr CPUIDSDK_fp_GetDisplayDriverVersion(IntPtr objptr);
private delegate IntPtr CPUIDSDK_fp_GetDirectXVersion(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetDisplayAdapterBusInfos(IntPtr objptr, int _adapter_index, ref int _bus_type, ref int _multi_vpu);
private delegate float CPUIDSDK_fp_GetDisplayAdapterManufacturingProcess(IntPtr objptr, int _adapter_index);
// HDD
private delegate int CPUIDSDK_fp_GetNumberOfHDD(IntPtr objptr);
private delegate int CPUIDSDK_fp_GetHDDDeviceNumber(IntPtr objptr, int _hdd_index);
private delegate IntPtr CPUIDSDK_fp_GetHDDName(IntPtr objptr, int _hdd_index);
private delegate IntPtr CPUIDSDK_fp_GetHDDRevision(IntPtr objptr, int _hdd_index);
private delegate IntPtr CPUIDSDK_fp_GetHDDSerialNumber(IntPtr objptr, int _hdd_index);
private delegate int CPUIDSDK_fp_GetHDDFitnessPercent(IntPtr objptr, int _hdd_index);
private delegate int CPUIDSDK_fp_GetHDDPerformancePercent(IntPtr objptr, int _hdd_index);
private delegate int CPUIDSDK_fp_GetHDDNumberOfVolumes(IntPtr objptr, int _hdd_index);
private delegate IntPtr CPUIDSDK_fp_GetHDDVolumeLetter(IntPtr objptr, int _hdd_index, int _volume_index);
private delegate IntPtr CPUIDSDK_fp_GetHDDVolumeName(IntPtr objptr, int _hdd_index, int _volume_index);
private delegate float CPUIDSDK_fp_GetHDDVolumeSize(IntPtr objptr, int _hdd_index, int _volume_index);
private delegate int CPUIDSDK_fp_GetHDDVolumeSerial(IntPtr objptr, int _hdd_index, int _volume_index);
private delegate int CPUIDSDK_fp_GetHDDNumberOfAttributes(IntPtr objptr, int _hdd_index);
private delegate int CPUIDSDK_fp_GetHDDAttribute(IntPtr objptr, int _hdd_index, int _attrib_index, ref int _id, ref int _flags, ref int _value, ref int _worst, byte[] _data);
protected IntPtr objptr = IntPtr.Zero;
// Instance management
public bool CreateInstance()
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x21452459);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_CreateInstance msd = (CPUIDSDK_fp_CreateInstance)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_CreateInstance));
objptr = msd();
if (objptr != IntPtr.Zero)
return true;
else
return false;
}
else
{
objptr = IntPtr.Zero;
return false;
}
}
catch (Exception e)
{
string message = e.Message;
return false;
}
}
public void DestroyInstance()
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x30571113);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_DestroyInstance msd = (CPUIDSDK_fp_DestroyInstance)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_DestroyInstance));
msd(objptr);
}
}
catch
{
}
}
public bool Init(string _szDllPath, string _szDllFilename, uint _config_flag, ref int _errorcode, ref int _extended_errorcode)
{
int res;
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x19937329);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_Init msd = (CPUIDSDK_fp_Init)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_Init));
res = msd(objptr, _szDllPath, _szDllFilename, (int)_config_flag, ref _errorcode, ref _extended_errorcode);
if (res == 1) return true;
else return false;
}
else
{
_errorcode = (int)CPUIDSDK_ERROR_INVALID_DLL;
}
return false;
}
catch
{
return false;
}
}
public void Close()
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x14862213);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_Close msd = (CPUIDSDK_fp_Close)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_Close));
msd(objptr);
}
}
catch
{
}
}
public void RefreshInformation()
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x75030260);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_RefreshInformation msd = (CPUIDSDK_fp_RefreshInformation)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_RefreshInformation));
msd(objptr);
}
}
catch
{
}
}
public void GetDllVersion(ref int _version)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x61956551);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetDllVersion msd = (CPUIDSDK_fp_GetDllVersion)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetDllVersion));
msd(objptr, ref _version);
}
}
catch
{
}
}
// Processor
public int GetNumberOfProcessors()
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x74126687);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetNbProcessors msd = (CPUIDSDK_fp_GetNbProcessors)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetNbProcessors));
return msd(objptr);
}
return I_UNDEFINED_VALUE;
}
catch
{
return I_UNDEFINED_VALUE;
}
}
public int GetProcessorFamily(int _proc_index)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x32350046);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetProcessorFamily msd = (CPUIDSDK_fp_GetProcessorFamily)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetProcessorFamily));
return msd(objptr, _proc_index);
}
return I_UNDEFINED_VALUE;
}
catch
{
return I_UNDEFINED_VALUE;
}
}
public int GetProcessorCoreCount(int _proc_index)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x70028077);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetProcessorCoreCount msd = (CPUIDSDK_fp_GetProcessorCoreCount)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetProcessorCoreCount));
return msd(objptr, _proc_index);
}
return I_UNDEFINED_VALUE;
}
catch
{
return I_UNDEFINED_VALUE;
}
}
public int GetProcessorThreadCount(int _proc_index)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x36189448);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetProcessorThreadCount msd = (CPUIDSDK_fp_GetProcessorThreadCount)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetProcessorThreadCount));
return msd(objptr, _proc_index);
}
return I_UNDEFINED_VALUE;
}
catch
{
return I_UNDEFINED_VALUE;
}
}
public int GetProcessorCoreThreadCount(int _proc_index, int _core_index)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x63895059);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetProcessorCoreThreadCount msd = (CPUIDSDK_fp_GetProcessorCoreThreadCount)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetProcessorCoreThreadCount));
return msd(objptr, _proc_index, _core_index);
}
return I_UNDEFINED_VALUE;
}
catch
{
return I_UNDEFINED_VALUE;
}
}
public int GetProcessorThreadAPICID(IntPtr objptr, int _proc_index, int _core_index, int _thread_index)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x5805773);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetProcessorThreadAPICID msd = (CPUIDSDK_fp_GetProcessorThreadAPICID)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetProcessorThreadAPICID));
return msd(objptr, _proc_index, _core_index, _thread_index);
}
return I_UNDEFINED_VALUE;
}
catch
{
return I_UNDEFINED_VALUE;
}
}
public string GetProcessorName(int _proc_index)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x20310671);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetProcessorName msd = (CPUIDSDK_fp_GetProcessorName)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetProcessorName));
IntPtr pointer = msd(objptr, _proc_index);
string tmp = Marshal.PtrToStringAnsi(pointer);
Marshal.FreeBSTR(pointer);
return tmp;
}
return null;
}
catch
{
return null;
}
}
public string GetProcessorCodeName(int _proc_index)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x49828055);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetProcessorCodeName msd = (CPUIDSDK_fp_GetProcessorCodeName)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetProcessorCodeName));
IntPtr pointer = msd(objptr, _proc_index);
string tmp = Marshal.PtrToStringAnsi(pointer);
Marshal.FreeBSTR(pointer);
return tmp;
}
return null;
}
catch
{
return null;
}
}
public string GetProcessorSpecification(int _proc_index)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x40463981);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetProcessorSpecification msd = (CPUIDSDK_fp_GetProcessorSpecification)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetProcessorSpecification));
IntPtr pointer = msd(objptr, _proc_index);
return (Marshal.PtrToStringAnsi(pointer));
}
return null;
}
catch
{
return null;
}
}
public string GetProcessorPackage(int _proc_index)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x1341414);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetProcessorPackage msd = (CPUIDSDK_fp_GetProcessorPackage)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetProcessorPackage));
IntPtr pointer = msd(objptr, _proc_index);
string tmp = Marshal.PtrToStringAnsi(pointer);
Marshal.FreeBSTR(pointer);
return tmp;
}
return null;
}
catch
{
return null;
}
}
public string GetProcessorStepping(int _proc_index)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x28151889);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetProcessorStepping msd = (CPUIDSDK_fp_GetProcessorStepping)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetProcessorStepping));
IntPtr pointer = msd(objptr, _proc_index);
string tmp = Marshal.PtrToStringAnsi(pointer);
Marshal.FreeBSTR(pointer);
return tmp;
}
return null;
}
catch
{
return null;
}
}
public float GetProcessorTDP(int _proc_index)
{
try
{
IntPtr ptr = CPUIDSDK_fp_QueryInterface(0x79867689);
if (ptr != IntPtr.Zero)
{
CPUIDSDK_fp_GetProcessorTDP msd = (CPUIDSDK_fp_GetProcessorTDP)Marshal.GetDelegateForFunctionPointer(ptr, typeof(CPUIDSDK_fp_GetProcessorTDP));
return msd(objptr, _proc_index);
}
return (float)F_UNDEFINED_VALUE;
}
catch
{
return (float)F_UNDEFINED_VALUE;
}
}
public float GetProcessorManufacturingProcess(int _proc_index)
{
try