]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/BootMaintenanceManagerUiLib/BmLib.c
MdeModulePkg/ReportStatusCodeLib: Avoid using AllocatePool if possible
[mirror_edk2.git] / MdeModulePkg / Library / BootMaintenanceManagerUiLib / BmLib.c
CommitLineData
4af04335
DB
1/** @file\r
2Utility routines used by boot maintenance modules.\r
3\r
d1102dba 4Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
4af04335
DB
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include "BootMaintenanceManager.h"\r
16\r
17/**\r
18 Function deletes the variable specified by VarName and VarGuid.\r
19\r
20 @param VarName A Null-terminated Unicode string that is\r
21 the name of the vendor's variable.\r
22\r
23 @param VarGuid A unique identifier for the vendor.\r
24\r
25 @retval EFI_SUCCESS The variable was found and removed\r
26 @retval EFI_UNSUPPORTED The variable store was inaccessible\r
27 @retval EFI_NOT_FOUND The variable was not found\r
28\r
29**/\r
30EFI_STATUS\r
31EfiLibDeleteVariable (\r
32 IN CHAR16 *VarName,\r
33 IN EFI_GUID *VarGuid\r
34 )\r
35{\r
36 return gRT->SetVariable (\r
37 VarName,\r
38 VarGuid,\r
39 0,\r
40 0,\r
41 NULL\r
42 );\r
43}\r
44\r
45/**\r
46 Function is used to determine the number of device path instances\r
47 that exist in a device path.\r
48\r
49\r
50 @param DevicePath A pointer to a device path data structure.\r
51\r
52 @return This function counts and returns the number of device path instances\r
53 in DevicePath.\r
54\r
55**/\r
56UINTN\r
57EfiDevicePathInstanceCount (\r
58 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
59 )\r
60{\r
61 UINTN Count;\r
62 UINTN Size;\r
63\r
64 Count = 0;\r
65 while (GetNextDevicePathInstance (&DevicePath, &Size) != NULL) {\r
66 Count += 1;\r
67 }\r
68\r
69 return Count;\r
70}\r
71\r
72/**\r
d1102dba 73 Get a string from the Data Hub record based on\r
4af04335
DB
74 a device path.\r
75\r
76 @param DevPath The device Path.\r
77\r
78 @return A string located from the Data Hub records based on\r
79 the device path.\r
80 @retval NULL If failed to get the String from Data Hub.\r
81\r
82**/\r
83UINT16 *\r
84EfiLibStrFromDatahub (\r
85 IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
86 )\r
87{\r
88 return NULL;\r
89}\r