TianoCore EDK2 master
Loading...
Searching...
No Matches
TlsAuthConfigDxe.c
Go to the documentation of this file.
1
10#include "TlsAuthConfigImpl.h"
11
22EFIAPI
24 IN EFI_HANDLE ImageHandle
25 )
26{
27 EFI_STATUS Status;
29
30 Status = gBS->HandleProtocol (
31 ImageHandle,
32 &gEfiCallerIdGuid,
33 (VOID **)&PrivateData
34 );
35 if (EFI_ERROR (Status)) {
36 return Status;
37 }
38
39 ASSERT (PrivateData->Signature == TLS_AUTH_CONFIG_PRIVATE_DATA_SIGNATURE);
40
41 gBS->UninstallMultipleProtocolInterfaces (
42 ImageHandle,
43 &gEfiCallerIdGuid,
44 PrivateData,
45 NULL
46 );
47
48 TlsAuthConfigFormUnload (PrivateData);
49
50 return EFI_SUCCESS;
51}
52
65EFIAPI
67 IN EFI_HANDLE ImageHandle,
68 IN EFI_SYSTEM_TABLE *SystemTable
69 )
70{
71 EFI_STATUS Status;
72
74
75 PrivateData = NULL;
76
77 //
78 // If already started, return.
79 //
80 Status = gBS->OpenProtocol (
81 ImageHandle,
82 &gEfiCallerIdGuid,
83 NULL,
84 ImageHandle,
85 ImageHandle,
86 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
87 );
88 if (!EFI_ERROR (Status)) {
89 return EFI_ALREADY_STARTED;
90 }
91
92 //
93 // Initialize the private data structure.
94 //
95 PrivateData = AllocateZeroPool (sizeof (TLS_AUTH_CONFIG_PRIVATE_DATA));
96 if (PrivateData == NULL) {
97 return EFI_OUT_OF_RESOURCES;
98 }
99
100 //
101 // Initialize the HII configuration form.
102 //
103 Status = TlsAuthConfigFormInit (PrivateData);
104 if (EFI_ERROR (Status)) {
105 goto ON_ERROR;
106 }
107
108 //
109 // Install private GUID.
110 //
111 Status = gBS->InstallMultipleProtocolInterfaces (
112 &ImageHandle,
113 &gEfiCallerIdGuid,
114 PrivateData,
115 NULL
116 );
117 if (EFI_ERROR (Status)) {
118 goto ON_ERROR;
119 }
120
121 return EFI_SUCCESS;
122
123ON_ERROR:
124 TlsAuthConfigFormUnload (PrivateData);
125
126 return Status;
127}
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
EFI_STATUS EFIAPI TlsAuthConfigDxeDriverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI TlsAuthConfigDxeUnload(IN EFI_HANDLE ImageHandle)
EFI_STATUS TlsAuthConfigFormInit(IN TLS_AUTH_CONFIG_PRIVATE_DATA *Private)
EFI_STATUS TlsAuthConfigFormUnload(IN TLS_AUTH_CONFIG_PRIVATE_DATA *Private)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS