SMBIOS Table

这里我借鉴了其他的一些博客
https://blog.csdn.net/zhangliang19950813/article/details/105842364
https://www.lab-z.com/stu248/
因为我自己的电脑是没有“SM”开头的,所以需要自己去找开始的地址

/** @file
  This sample application bases on HelloWorld PCD setting 
  to print "UEFI Hello World!" to the UEFI Console.

  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
  This program and the accompanying materials                          
  are licensed and made available under the terms and conditions of the BSD License         
  which accompanies this distribution.  The full text of the license may be found at        
  http://opensource.org/licenses/bsd-license.php                                            

  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             

**/

#include "SmBios.h"


#pragma optimize("",off)
EFI_SMBIOS_PROTOCOL  *gEfiSmBios;

EFI_STATUS
PrintGuid (
  IN EFI_GUID *Guid
  )
  

{
  if (Guid == NULL) {
	Print(L"Parameter error!\n");
    return EFI_INVALID_PARAMETER;
  }

  Print (
    L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x ",
    (unsigned) Guid->Data1,
    Guid->Data2,
    Guid->Data3,
    Guid->Data4[0],
    Guid->Data4[1],
    Guid->Data4[2],
    Guid->Data4[3],
    Guid->Data4[4],
    Guid->Data4[5],
    Guid->Data4[6],
    Guid->Data4[7]
    );
  return EFI_SUCCESS;
}

UINTN
CompareGUID (
  IN EFI_GUID *Guid1,
  IN EFI_GUID *Guid2
  )
  
{

  if ((Guid1 == NULL)||(Guid2 == NULL)) {
	Print(L"Parameter error!\n");
    return 2;
  }

  if ((Guid1->Data1 != Guid2->Data1) ||
	  (Guid1->Data2 != Guid2->Data2) ||
	  (Guid1->Data3 != Guid2->Data3) ||
      (Guid1->Data4[0] != Guid2->Data4[0]) ||
      (Guid1->Data4[1] != Guid2->Data4[1]) ||
	  (Guid1->Data4[2] != Guid2->Data4[2]) ||
      (Guid1->Data4[3] != Guid2->Data4[3]) ||
      (Guid1->Data4[4] != Guid2->Data4[4]) ||
	  (Guid1->Data4[5] != Guid2->Data4[5]) ||
      (Guid1->Data4[6] != Guid2->Data4[6]) ||
      (Guid1->Data4[7] != Guid2->Da
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值