ReactOS  0.4.14-dev-49-gfb4591c
dmilib.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  _ID_STRINGS {
  ID_NONE = 0, BIOS_VENDOR, BIOS_VERSION, BIOS_DATE,
  SYS_VENDOR, SYS_PRODUCT, SYS_VERSION, SYS_SERIAL,
  SYS_SKU, SYS_FAMILY, BOARD_VENDOR, BOARD_NAME,
  BOARD_VERSION, BOARD_SERIAL, BOARD_ASSET_TAG, ID_STRINGS_MAX
}
 

Functions

VOID ParseSMBiosTables (_In_reads_bytes_(TableSize) PVOID SMBiosTables, _In_ ULONG TableSize, _Inout_updates_(ID_STRINGS_MAX) PCHAR *Strings)
 

Enumeration Type Documentation

◆ _ID_STRINGS

Enumerator
ID_NONE 
BIOS_VENDOR 
BIOS_VERSION 
BIOS_DATE 
SYS_VENDOR 
SYS_PRODUCT 
SYS_VERSION 
SYS_SERIAL 
SYS_SKU 
SYS_FAMILY 
BOARD_VENDOR 
BOARD_NAME 
BOARD_VERSION 
BOARD_SERIAL 
BOARD_ASSET_TAG 
ID_STRINGS_MAX 

Definition at line 12 of file dmilib.h.

Function Documentation

◆ ParseSMBiosTables()

VOID ParseSMBiosTables ( _In_reads_bytes_(TableSize) PVOID  SMBiosTables,
_In_ ULONG  TableSize,
_Inout_updates_(ID_STRINGS_MAX) PCHAR Strings 
)

Definition at line 41 of file dmilib.c.

45 {
46  PMSSmBios_RawSMBiosTables BiosTablesHeader = SMBiosTables;
48  ULONG Remaining;
49  PCHAR Data;
50 
51  Header = (PDMI_HEADER)(&BiosTablesHeader->SMBiosData);
52  Remaining = BiosTablesHeader->Size;
53 
54  while (Remaining >= sizeof(*Header))
55  {
56  if (Header->Type == DMI_ENTRY_END_OF_TABLE)
57  break;
58 
59  switch (Header->Type)
60  {
61  case DMI_ENTRY_BIOS:
62  if (Remaining < DMI_BIOS_SIZE)
63  return;
67  break;
68 
69  case DMI_ENTRY_SYSTEM:
70  if (Remaining < DMI_SYS_SIZE)
71  return;
78  break;
79 
81  if (Remaining < DMI_BOARD_SIZE)
82  return;
88  break;
89 
90  case DMI_ENTRY_CHASSIS:
93  // DMI_ENTRY_IPMI_DEV?
94  // DMI_ENTRY_ONBOARD_DEV_EXT?
95  break;
96  }
97 
98  Remaining -= Header->Length;
99  Data = (PCHAR)Header + Header->Length;
100 
101  /* Now loop until we find 2 zeroes */
102  while ((Remaining >= 2) && ((Data[0] != 0) || (Data[1] != 0)))
103  {
104  Data++;
105  Remaining--;
106  }
107 
108  if (Remaining < 2)
109  break;
110 
111  /* Go to the next header */
112  Remaining -= 2;
113  Header = (PDMI_HEADER)((PUCHAR)Data + 2);
114  }
115 }
signed char * PCHAR
Definition: retypes.h:7
Definition: dmilib.h:22
unsigned char * PUCHAR
Definition: retypes.h:3
struct _DMI_HEADER * PDMI_HEADER
while(1)
Definition: macro.lex.yy.c:740
Definition: Header.h:8
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
#define PCHAR
Definition: match.c:90
static const WCHAR Strings[]
Definition: reg.c:35
static PCHAR GetDmiString(_In_ PDMI_HEADER Header, _In_ ULONG FieldOffset)
Definition: dmilib.c:14
unsigned int ULONG
Definition: retypes.h:1

Referenced by i8042ParseSMBiosTables(), and LoadSMBiosData().