2 Lib fucntions for SMBIOS. Used to get system serial number and GUID
4 Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "../UefiShellDebug1CommandsLib.h"
16 #include <Guid/Smbios.h>
17 #include "LibSmbios.h"
20 Return SMBIOS string given the string number.
22 @param[in] Smbios Pointer to SMBIOS structure.
23 @param[in] StringNumber String number to return. -1 is used to skip all strings and
24 point to the next SMBIOS structure.
26 @return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1
30 IN SMBIOS_STRUCTURE_POINTER
*Smbios
,
31 IN UINT16 StringNumber
37 ASSERT (Smbios
!= NULL
);
40 // Skip over formatted section
42 String
= (CHAR8
*) (Smbios
->Raw
+ Smbios
->Hdr
->Length
);
45 // Look through unformated section
47 for (Index
= 1; Index
<= StringNumber
; Index
++) {
48 if (StringNumber
== Index
) {
54 for (; *String
!= 0; String
++);
59 // If double NULL then we are done.
60 // Retrun pointer to next structure in Smbios.
61 // if you pass in a -1 you will always get here
63 Smbios
->Raw
= (UINT8
*)++String
;