\r
#include "HttpDriver.h"\r
\r
+EFI_HTTP_UTILITIES_PROTOCOL *mHttpUtilities = NULL;\r
+\r
///\r
/// Driver Binding Protocol instance\r
///\r
}\r
}\r
\r
+/**\r
+ The event process routine when the http utilities protocol is installed\r
+ in the system.\r
+\r
+ @param[in] Event Not used.\r
+ @param[in] Context The pointer to the IP4 config2 instance data.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+HttpUtilitiesInstalledCallback (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ gBS->LocateProtocol (\r
+ &gEfiHttpUtilitiesProtocolGuid, \r
+ NULL, \r
+ (VOID **) &mHttpUtilities\r
+ );\r
+ \r
+ //\r
+ // Close the event if Http utilities protocol is loacted.\r
+ //\r
+ if (mHttpUtilities != NULL && Event != NULL) {\r
+ gBS->CloseEvent (Event);\r
+ }\r
+}\r
+\r
/**\r
This is the declaration of an EFI image entry point. This entry point is\r
the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
-{\r
+{ \r
+ VOID *Registration;\r
+\r
+ gBS->LocateProtocol (\r
+ &gEfiHttpUtilitiesProtocolGuid, \r
+ NULL, \r
+ (VOID **) &mHttpUtilities\r
+ );\r
+\r
+ if (mHttpUtilities == NULL) {\r
+ //\r
+ // No Http utilities protocol, register a notify.\r
+ //\r
+ EfiCreateProtocolNotifyEvent (\r
+ &gEfiHttpUtilitiesProtocolGuid,\r
+ TPL_CALLBACK,\r
+ HttpUtilitiesInstalledCallback,\r
+ NULL,\r
+ &Registration\r
+ );\r
+ }\r
+\r
//\r
// Install UEFI Driver Model protocol(s).\r
//\r