]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/HiiLib/HiiLib.c
Maintainers.txt: Remove EdkCompatibilityPkg information
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / HiiLib / HiiLib.c
CommitLineData
3eb9473e 1/*++\r
2\r
4ac4deb7 3Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
2c7e5c2f 4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12\r
13Module Name:\r
14\r
15 HiiLib.c\r
16 \r
17Abstract: \r
18\r
19 HII Library implementation that uses DXE protocols and services.\r
20\r
21--*/\r
22\r
23#include "EdkIIGlueDxe.h"\r
24\r
c7f33ca4 25#if (EFI_SPECIFICATION_VERSION < 0x0002000A)\r
3eb9473e 26/**\r
27 This function allocates pool for an EFI_HII_PACKAGES structure\r
28 with enough space for the variable argument list of package pointers.\r
29 The allocated structure is initialized using NumberOfPackages, Guid, \r
30 and the variable length argument list of package pointers.\r
31\r
32 @param NumberOfPackages The number of HII packages to prepare.\r
33 @param Guid Package GUID.\r
34\r
35 @return The allocated and initialized packages.\r
36\r
37**/\r
38EFI_HII_PACKAGES *\r
39EFIAPI\r
40GluePreparePackages (\r
41 IN UINTN NumberOfPackages,\r
42 IN CONST EFI_GUID *Guid OPTIONAL,\r
43 ...\r
44 )\r
45{\r
46 VA_LIST Args;\r
47 EFI_HII_PACKAGES *HiiPackages;\r
48 VOID **Package;\r
49 UINTN Index;\r
50\r
51 ASSERT (NumberOfPackages > 0);\r
52\r
53 HiiPackages = AllocateZeroPool (sizeof (EFI_HII_PACKAGES) + NumberOfPackages * sizeof (VOID *));\r
54 ASSERT (HiiPackages != NULL);\r
4ac4deb7
LG
55 if (HiiPackages == NULL) {\r
56 return NULL;\r
57 }\r
3eb9473e 58\r
59 HiiPackages->GuidId = (EFI_GUID *) Guid;\r
60 HiiPackages->NumberOfPackages = NumberOfPackages;\r
61 Package = (VOID **) (((UINT8 *) HiiPackages) + sizeof (EFI_HII_PACKAGES));\r
62\r
63 VA_START (Args, Guid);\r
64\r
65 for (Index = 0; Index < NumberOfPackages; Index++) {\r
66 *Package = VA_ARG (Args, VOID *);\r
67 Package++;\r
68 }\r
69\r
70 VA_END (Args);\r
71\r
72 return HiiPackages;\r
73\r
74}\r
c7f33ca4 75#endif\r