TianoCore EDK2 master
Loading...
Searching...
No Matches
HttpUtilitiesDxe.c
Go to the documentation of this file.
1
10#include "HttpUtilitiesDxe.h"
11
22EFIAPI
24 IN EFI_HANDLE ImageHandle
25 )
26{
27 EFI_STATUS Status;
28 UINTN HandleNum;
29 EFI_HANDLE *HandleBuffer;
30 UINT32 Index;
31 EFI_HTTP_UTILITIES_PROTOCOL *HttpUtilitiesProtocol;
32
33 HandleBuffer = NULL;
34
35 //
36 // Locate all the handles with HttpUtilities protocol.
37 //
38 Status = gBS->LocateHandleBuffer (
40 &gEfiHttpUtilitiesProtocolGuid,
41 NULL,
42 &HandleNum,
43 &HandleBuffer
44 );
45 if (EFI_ERROR (Status)) {
46 return Status;
47 }
48
49 for (Index = 0; Index < HandleNum; Index++) {
50 //
51 // Firstly, find HttpUtilitiesProtocol interface
52 //
53 Status = gBS->OpenProtocol (
54 HandleBuffer[Index],
55 &gEfiHttpUtilitiesProtocolGuid,
56 (VOID **)&HttpUtilitiesProtocol,
57 ImageHandle,
58 NULL,
59 EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL
60 );
61 if (EFI_ERROR (Status)) {
62 return Status;
63 }
64
65 //
66 // Then, uninstall HttpUtilities interface
67 //
68 Status = gBS->UninstallMultipleProtocolInterfaces (
69 HandleBuffer[Index],
70 &gEfiHttpUtilitiesProtocolGuid,
71 HttpUtilitiesProtocol,
72 NULL
73 );
74 if (EFI_ERROR (Status)) {
75 return Status;
76 }
77 }
78
79 return EFI_SUCCESS;
80}
81
94EFIAPI
96 IN EFI_HANDLE ImageHandle,
97 IN EFI_SYSTEM_TABLE *SystemTable
98 )
99{
100 EFI_STATUS Status;
101
102 EFI_HANDLE Handle;
103
104 Handle = NULL;
105
106 //
107 // Install the HttpUtilities Protocol onto Handle
108 //
109 Status = gBS->InstallMultipleProtocolInterfaces (
110 &Handle,
111 &gEfiHttpUtilitiesProtocolGuid,
112 &mHttpUtilitiesProtocol,
113 NULL
114 );
115
116 return Status;
117}
UINT64 UINTN
EFI_STATUS EFIAPI HttpUtilitiesDxeDriverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI HttpUtilitiesDxeUnload(IN EFI_HANDLE ImageHandle)
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
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
@ ByProtocol
Definition: UefiSpec.h:1518