-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFunctions.h
291 lines (171 loc) · 9.75 KB
/
Functions.h
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
#include "Structures.h"
#include <vector>
#include <string>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <math.h>
/** Get the Raw SMBIOS table */
RawSMBIOSData* getRawData();
/** Display available user commands */
void displayCommands();
/** Display the entire SMBIOS table of data in hexadecimal by byte */
void displayHexContents(RawSMBIOSData* rawData);
/** Display each structure in a list */
void displayAllStructures(RawSMBIOSData* rawData);
/** Get a list of structures from the raw data */
std::vector<SMBIOSStruct*> getStructureTable(RawSMBIOSData* rawData);
/** Get the next SMBIOS structure after the current one */
SMBIOSStruct* getNextStruct(SMBIOSStruct* curStruct);
/** Get the strings that are associated with the current structure */
std::vector<std::string> getStrings(SMBIOSStruct* curStruct);
/** Display the structure table alone */
void displayStructureTable(RawSMBIOSData* rawData);
/** Display a specific SMBIOS structure from the table */
void displayStructure(RawSMBIOSData* rawData, int id);
/** Get a specific bit from an array of bytes */
int getBit(BYTE bytes[], int bitNum, int numBits);
/** Get a specific bit from a byte */
int getBit(BYTE byte, int bitNum);
/** Get a specific bit from a word */
int getBit(WORD word, int bitNum);
/** Get consecutive bits from a byte */
int getBits(BYTE byte, int startBit, int endBit);
/** Get consecutive bits from a word */
int getBits(WORD word, int startBit, int endBit);
/** Display minimal information about the vendor-specific, non-required structures */
void displayInformation(SMBIOSStructNonRequired* curStruct);
/** Display System BIOS Information (Type 0) */
void displayInformation(SMBIOSStructType0* curStruct, RawSMBIOSData* rawData);
/** Display BIOS Characteristics for the type 0 structure */
void displayBIOSCharacteristics(SMBIOSStructType0* curStruct);
/** Display BIOS Extended characteristics for the type 0 structure */
void displayBIOSExtendedCharacteristics(SMBIOSStructType0* curStruct);
/** Display System Information (Type 1) */
void displayInformation(SMBIOSStructType1* curStruct, RawSMBIOSData* rawData);
/** Get the wakeup type field for the type 1 structure */
std::string getWakeUpType(SMBIOSStructType1* curStruct);
/** Display Baseboard Information (Type 2) */
void displayInformation(SMBIOSStructType2* curStruct, RawSMBIOSData* rawData);
/** Display Feature Flags for the type 2 structure */
void displayFeatureFlags(SMBIOSStructType2* curStruct);
/** Determine the Baseboard type for the type 2 structure */
std::string getBaseBoardType(SMBIOSStructType2* curStruct);
/** Display Chassis Information (Type 3) */
void displayInformation(SMBIOSStructType3* curStruct, RawSMBIOSData* rawData);
/** Display the Chassis Type for the type 3 structure */
void displayChassisType(SMBIOSStructType3* curStruct);
/** Get the chassis state for the type 3 structure */
std::string getChassisState(BYTE field);
/** Get the chassis security state for the type 3 structure */
std::string getChassisSecurityState(BYTE field);
/** Display Processor Information (Type 4) */
void displayInformation(SMBIOSStructType4* curStruct, RawSMBIOSData* rawData);
/** Display the processor's characteristics for the type 4 structure */
void displayProcessorCharacteristics(SMBIOSStructType4* curStruct);
/** Get the processor's type for the type 4 structure */
std::string getProcessorType(SMBIOSStructType4* curStruct);
/** Get the processor's family for the type 4 structure */
std::string getProcessorFamily(SMBIOSStructType4* curStruct);
/** Get the voltage for the type 4 structure */
std::string getVoltage(SMBIOSStructType4* curStruct);
/** Get the status of the processor for the type 4 structure*/
void getProcessorStatus(SMBIOSStructType4* curStruct);
/** Get the processor upgrade information for the type 4 structure */
std::string getProcessorUpgrade(SMBIOSStructType4* curStruct);
/** Get the processor's second family for the type 4 structure */
std::string getProcessorFamily2(SMBIOSStructType4* curStruct);
/** Display Memory Controller Information (Type 5) */
void displayInformation(SMBIOSStructType5* curStruct, RawSMBIOSData* rawData);
/** Get the error detecting method for the type 5 structure */
std::string getErrorDetectingMethod(SMBIOSStructType5* curStruct);
/** Get the error correcting capability for the type 5 structure */
void displayErrorCorrectingCapability(SMBIOSStructType5* curStruct);
/** Get the interleave support for the type 5 structure */
std::string getInterleaveSupport(BYTE Interleave);
/** Get the supported speeds for the type 5 structure */
void displaySupportedSpeeds(SMBIOSStructType5* curStruct);
/** Get the supported memory types for the type 5 structure */
void displaySupportedMemoryTypes(SMBIOSStructType5* curStruct);
/** Get the required voltages for the memory module sockets */
void displayMemoryModuleVolate(SMBIOSStructType5* curStruct);
/** Display Memory Module Information (Type 6) */
void displayInformation(SMBIOSStructType6* curStruct, RawSMBIOSData* rawData);
/** Get the current memory type for the type 6 structure */
void displayCurrentMemoryType(SMBIOSStructType6* curStruct);
/** Get the specified size for the type 6 structure */
void displaySize(WORD size);
/** Get the error status for the type 6 structure */
void displayErrorStatus(SMBIOSStructType6* curStruct);
/** Display Cache Information (Type 7) */
void displayInformation(SMBIOSStructType7* curStruct, RawSMBIOSData* rawData);
/** Get the error correction type for the type 7 structure */
std::string getErrorCorrectionTypeField(SMBIOSStructType7* curStruct);
/** Get the system cache type field for the type 7 structure */
std::string getSystemCachetypeField(SMBIOSStructType7* curStruct);
/** Get the associativity of the cache for the type 7 structure */
std::string getAssociativity(SMBIOSStructType7* curStruct);
/** Display the cache configuration information for the type 7 structure */
void displayCacheConfiguration(SMBIOSStructType7* curStruct);
/** Display the cache size for the type 7 structure */
void displayCacheSize(WORD CacheSize);
/** Display the SRAM type for the type 7 structure */
void displaySRAMType(SMBIOSStructType7* curStruct);
/** Display Port Connector Information (Type 8) */
void displayInformation(SMBIOSStructType8* curStruct, RawSMBIOSData* rawData);
/** Display the internal connector type for the type 8 structure */
std::string getConnectorType(BYTE connector);
/** Display the port type for the type 8 structure */
std::string getPortType(SMBIOSStructType8* curStruct);
/** Display System Slots Information (Type 9) */
void displayInformation(SMBIOSStructType9* curStruct, RawSMBIOSData* rawData);
/** Display the slot's first set of characteristics for the type 9 structure */
void displaySlotCharacteristics1(SMBIOSStructType9* curStruct);
/** Display the slot's second set of characteristics for the type 9 structure */
void displaySlotCharacteristics2(SMBIOSStructType9* curStruct);
/** Get the slot type field for the type 9 structure */
std::string getSlotTypeField(SMBIOSStructType9* curStruct);
/** Get the slot's data bus width for the type 9 structure */
std::string getSlotDataBusWidth(SMBIOSStructType9* curStruct);
/** Get the current usage enumeration for the type 9 structure */
std::string getCurrentUsage(SMBIOSStructType9* curStruct);
/** Get the slot's length enumeration for the type 9 structure */
std::string getSlotLength(SMBIOSStructType9* curStruct);
/** Display On Board Devices Information (Type 10) */
void displayInformation(SMBIOSStructType10* curStruct, RawSMBIOSData* rawData);
/** Display the device type for the type 10 structure */
std::string getDeviceType(SMBIOSStructType10* curStruct);
/** Display OEM Strings Information (Type 11) */
void displayInformation(SMBIOSStructType11* curStruct, RawSMBIOSData* rawData);
/** Display System Configuration Options Information (Type 12) */
void displayInformation(SMBIOSStructType12* curStruct, RawSMBIOSData* rawData);
/** Dispay BIOS Language Information (Type 13) */
void displayInformation(SMBIOSStructType13* curStruct, RawSMBIOSData* rawData);
/** Display Group Associations Information (Type 14) */
void displayInformation(SMBIOSStructType14* curStruct, RawSMBIOSData* rawData);
/** Display System Event Log Information (Type 15) */
void displayInformation(SMBIOSStructType15* curStruct, RawSMBIOSData* rawData);
/** Get the access method for the type 15 structure */
std::string getAccessMethod(BYTE accessMethod);
/** Display Physical Memory Array Information (Type 16) */
void displayInformation(SMBIOSStructType16* curStruct, RawSMBIOSData* rawData);
/** Get the location enumeration for the type 16 structure */
std::string getLocation(SMBIOSStructType16* curStruct);
/** Get the use enumeration for the type 16 structure */
std::string getUse(SMBIOSStructType16* curStruct);
/** Get the error correction type enumeration for the type 16 structure */
std::string getErrorCorrectionType(SMBIOSStructType16* curStruct);
/** Display Memory Device Information (Type 17) */
void displayInformation(SMBIOSStructType17* curStruct, RawSMBIOSData* rawData);
/** Get the form factor enumeration for the type 17 structure */
std::string getFormFactor(SMBIOSStructType17* curStruct);
/** Get the memory device type enumeration for the type 17 structure */
std::string getMemoryDeviceType(SMBIOSStructType17* curStruct);
/** Display details about the memory device type */
void displayTypeDetail(SMBIOSStructType17* curStruct);
/** Display Memory Array Mapped Address (Type 19) */
void displayInformation(SMBIOSStructType19* curStruct, RawSMBIOSData* rawData);
/** Display System Boot Information (Type 32) */
void displayInformation(SMBIOSStructType32* curStruct, RawSMBIOSData* rawData);
/** Get the boot status enumeration for the type structure */
std::string getBootStatus(SMBIOSStructType32* curStruct);