Fill the ImageHandle and DriverBindingHandle field of Driver Binding Protocol before...
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 10 Jul 2013 02:06:49 +0000 (02:06 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 10 Jul 2013 02:06:49 +0000 (02:06 +0000)
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14460 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.c
IntelFrameworkPkg/Library/FrameworkUefiLib/UefiDriverModel.c
MdePkg/Library/UefiLib/UefiDriverModel.c

index c82736c..d5af3d6 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -40,23 +40,26 @@ UefiDriverModelLibConstructor (
   )\r
 {\r
   EFI_STATUS                   Status = EFI_UNSUPPORTED;\r
-  EFI_HANDLE                   DriverBindingHandle;\r
   EFI_DRIVER_BINDING_PROTOCOL  *DriverBinding;\r
 \r
   //\r
+  // The Driver Binding Protocol must never be NULL\r
+  //\r
+  DriverBinding = (EFI_DRIVER_BINDING_PROTOCOL *) _gDriverModelProtocolList[0].DriverBinding;\r
+  ASSERT(DriverBinding != NULL);\r
+\r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
   // Install the first Driver Bindng Protocol onto ImageHandle\r
   //\r
-  DriverBindingHandle = ImageHandle;\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = ImageHandle;\r
 \r
   //\r
   // See if onle one Driver Binding Protocol is advertised by the driver\r
   // EdkIIGlueLib: _gDriverModelProtocolListEntries is always 1\r
   //\r
 \r
-  //\r
-  // The Driver Binding Protocol must never be NULL\r
-  //\r
-  ASSERT(_gDriverModelProtocolList[0].DriverBinding != NULL);\r
 \r
   //\r
   // Check for all 8 possible combinations of the ComponentName, DriverConfiguration, and DriverDiagnostics Protocol\r
@@ -68,14 +71,14 @@ UefiDriverModelLibConstructor (
       if (_gDriverModelProtocolList[0].DriverConfiguration == NULL) {\r
         if (_gDriverModelProtocolList[0].ComponentName == NULL) {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                           NULL\r
                           );\r
         } else {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                           &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,\r
                           NULL\r
                           );\r
@@ -83,15 +86,15 @@ UefiDriverModelLibConstructor (
       } else {\r
         if (_gDriverModelProtocolList[0].ComponentName == NULL) {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,       (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                           &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,\r
                           NULL\r
                           );\r
         } else {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,       (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                           &gEfiComponentNameProtocolGuid,       (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,\r
                           &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,\r
                           NULL\r
@@ -102,15 +105,15 @@ UefiDriverModelLibConstructor (
       if (_gDriverModelProtocolList[0].DriverConfiguration == NULL) {\r
         if (_gDriverModelProtocolList[0].ComponentName == NULL) {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,     (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,     DriverBinding,\r
                           &gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,\r
                           NULL\r
                           );\r
         } else {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,     (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,     DriverBinding,\r
                           &gEfiComponentNameProtocolGuid,     (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,\r
                           &gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,\r
                           NULL\r
@@ -119,16 +122,16 @@ UefiDriverModelLibConstructor (
       } else {\r
         if (_gDriverModelProtocolList[0].ComponentName == NULL) {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,       (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                           &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,\r
                           &gEfiDriverDiagnosticsProtocolGuid,   (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,\r
                           NULL\r
                           );\r
         } else {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,       (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                           &gEfiComponentNameProtocolGuid,       (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,\r
                           &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,\r
                           &gEfiDriverDiagnosticsProtocolGuid,   (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,\r
@@ -144,14 +147,14 @@ UefiDriverModelLibConstructor (
       if (_gDriverModelProtocolList[0].DriverConfiguration2== NULL) {\r
         if (_gDriverModelProtocolList[0].ComponentName2== NULL) {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                           NULL\r
                           );\r
         } else {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,  (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,  DriverBinding,\r
                           &gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,\r
                           NULL\r
                           );\r
@@ -159,15 +162,15 @@ UefiDriverModelLibConstructor (
       } else {\r
         if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,        (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,        DriverBinding,\r
                           &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,\r
                           NULL\r
                           );\r
         } else {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,        (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,        DriverBinding,\r
                           &gEfiComponentName2ProtocolGuid,       (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,\r
                           &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,\r
                           NULL\r
@@ -178,15 +181,15 @@ UefiDriverModelLibConstructor (
       if (_gDriverModelProtocolList[0].DriverConfiguration2 == NULL) {\r
         if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,      (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,      DriverBinding,\r
                           &gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,\r
                           NULL\r
                           );\r
         } else {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,      (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,      DriverBinding,\r
                           &gEfiComponentName2ProtocolGuid,     (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,\r
                           &gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,\r
                           NULL\r
@@ -195,16 +198,16 @@ UefiDriverModelLibConstructor (
       } else {\r
         if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,        (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,        DriverBinding,\r
                           &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,\r
                           &gEfiDriverDiagnostics2ProtocolGuid,   (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,\r
                           NULL\r
                           );\r
         } else {\r
           Status = gBS->InstallMultipleProtocolInterfaces (\r
-                          &DriverBindingHandle,\r
-                          &gEfiDriverBindingProtocolGuid,        (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,\r
+                          &DriverBinding->DriverBindingHandle,\r
+                          &gEfiDriverBindingProtocolGuid,        DriverBinding,\r
                           &gEfiComponentName2ProtocolGuid,       (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,\r
                           &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,\r
                           &gEfiDriverDiagnostics2ProtocolGuid,   (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,\r
@@ -219,16 +222,7 @@ UefiDriverModelLibConstructor (
   // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
   //\r
   ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding = (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding;\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
-  \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 /**\r
index 39ab8de..9cd35fb 100644 (file)
@@ -2,7 +2,7 @@
   Library functions that abstract driver model protocols\r
   installation.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials are\r
   licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -51,8 +51,14 @@ EfiLibInstallDriverBinding (
 \r
   ASSERT (DriverBinding != NULL);\r
 \r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &DriverBindingHandle,\r
+                  &DriverBinding->DriverBindingHandle,\r
                   &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                   NULL\r
                   );\r
@@ -61,12 +67,6 @@ EfiLibInstallDriverBinding (
   //\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
   return Status;\r
 }\r
 \r
@@ -113,17 +113,23 @@ EfiLibInstallAllDriverProtocols (
 \r
   ASSERT (DriverBinding != NULL);\r
 \r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+\r
   if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
     if (DriverConfiguration == NULL) {\r
       if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                         NULL\r
                         );\r
       } else {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                         &gEfiComponentNameProtocolGuid, ComponentName,\r
                         NULL\r
@@ -132,14 +138,14 @@ EfiLibInstallAllDriverProtocols (
     } else {\r
       if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                         &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                         NULL\r
                         );\r
       } else {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                         &gEfiComponentNameProtocolGuid,       ComponentName,\r
                         &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -151,14 +157,14 @@ EfiLibInstallAllDriverProtocols (
     if (DriverConfiguration == NULL) {\r
       if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,     DriverBinding,\r
                         &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
                         NULL\r
                         );\r
       } else {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,     DriverBinding,\r
                         &gEfiComponentNameProtocolGuid,     ComponentName,\r
                         &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -168,7 +174,7 @@ EfiLibInstallAllDriverProtocols (
     } else {\r
       if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                         &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                         &gEfiDriverDiagnosticsProtocolGuid,   DriverDiagnostics,\r
@@ -176,7 +182,7 @@ EfiLibInstallAllDriverProtocols (
                         );\r
       } else {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                         &gEfiComponentNameProtocolGuid,       ComponentName,\r
                         &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -192,12 +198,6 @@ EfiLibInstallAllDriverProtocols (
   //\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
   return Status;\r
 }\r
 \r
@@ -241,16 +241,22 @@ EfiLibInstallDriverBindingComponentName2 (
 \r
   ASSERT (DriverBinding != NULL);\r
 \r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+\r
   if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
     if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
       Status = gBS->InstallMultipleProtocolInterfaces (\r
-                      &DriverBindingHandle,\r
+                      &DriverBinding->DriverBindingHandle,\r
                       &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                       NULL\r
                       );\r
       } else {\r
       Status = gBS->InstallMultipleProtocolInterfaces (\r
-                      &DriverBindingHandle,\r
+                      &DriverBinding->DriverBindingHandle,\r
                       &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                       &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                       NULL\r
@@ -259,14 +265,14 @@ EfiLibInstallDriverBindingComponentName2 (
   } else {\r
      if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                       &DriverBindingHandle,\r
+                       &DriverBinding->DriverBindingHandle,\r
                        &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                        &gEfiComponentNameProtocolGuid, ComponentName,\r
                        NULL\r
                        );\r
      } else {\r
        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                       &DriverBindingHandle,\r
+                       &DriverBinding->DriverBindingHandle,\r
                        &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                        &gEfiComponentNameProtocolGuid, ComponentName,\r
                        &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -274,17 +280,12 @@ EfiLibInstallDriverBindingComponentName2 (
                        );\r
     }\r
   }\r
+\r
   //\r
   // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
   //\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
   return Status;\r
 }\r
 \r
@@ -300,7 +301,7 @@ EfiLibInstallDriverBindingComponentName2 (
   DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver\r
   produces multiple Driver Binding Protocols. \r
   If DriverBinding is NULL, then ASSERT(). \r
-  If the installation fails, then ASSERT().  \r
+  If the installation fails, then ASSERT().\r
 \r
 \r
   @param  ImageHandle           The image handle of the driver.\r
@@ -338,6 +339,12 @@ EfiLibInstallAllDriverProtocols2 (
 \r
   ASSERT (DriverBinding != NULL); \r
 \r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+  \r
   if (DriverConfiguration2 == NULL) {\r
     if (DriverConfiguration == NULL) {\r
       if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
@@ -345,13 +352,13 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               NULL\r
@@ -360,14 +367,14 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -379,14 +386,14 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
@@ -396,7 +403,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
@@ -404,7 +411,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -419,14 +426,14 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -436,7 +443,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -444,7 +451,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -457,7 +464,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
@@ -465,7 +472,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -476,7 +483,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -485,7 +492,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -503,14 +510,14 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -520,7 +527,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -528,7 +535,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -541,7 +548,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
@@ -549,7 +556,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -560,7 +567,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -569,7 +576,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -585,7 +592,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -593,7 +600,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -604,7 +611,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -613,7 +620,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -627,7 +634,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -636,7 +643,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -648,7 +655,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -658,7 +665,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -679,14 +686,14 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -696,7 +703,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -704,7 +711,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -717,7 +724,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -725,7 +732,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -736,7 +743,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -745,7 +752,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -761,7 +768,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -769,7 +776,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -780,7 +787,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -789,7 +796,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -803,7 +810,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -812,7 +819,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -824,7 +831,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -834,7 +841,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -853,7 +860,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -861,7 +868,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -872,7 +879,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -881,7 +888,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -895,7 +902,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -904,7 +911,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -916,7 +923,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -926,7 +933,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -943,7 +950,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -952,7 +959,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -964,7 +971,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -974,7 +981,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -989,7 +996,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -999,7 +1006,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -1012,7 +1019,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -1023,7 +1030,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -1040,19 +1047,10 @@ EfiLibInstallAllDriverProtocols2 (
     }\r
   }\r
 \r
-\r
   //\r
   // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
   //\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
   return Status;\r
 }\r
-\r
-\r
index 05f6ec8..fb6067e 100644 (file)
@@ -2,7 +2,7 @@
   Library functions that abstract driver model protocols\r
   installation.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials are\r
   licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -51,8 +51,14 @@ EfiLibInstallDriverBinding (
 \r
   ASSERT (DriverBinding != NULL);\r
 \r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &DriverBindingHandle,\r
+                  &DriverBinding->DriverBindingHandle,\r
                   &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                   NULL\r
                   );\r
@@ -61,12 +67,6 @@ EfiLibInstallDriverBinding (
   //\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
   return Status;\r
 }\r
 \r
@@ -113,17 +113,23 @@ EfiLibInstallAllDriverProtocols (
 \r
   ASSERT (DriverBinding != NULL);\r
 \r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+  \r
   if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
     if (DriverConfiguration == NULL) {\r
       if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                         NULL\r
                         );\r
       } else {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                         &gEfiComponentNameProtocolGuid, ComponentName,\r
                         NULL\r
@@ -132,14 +138,14 @@ EfiLibInstallAllDriverProtocols (
     } else {\r
       if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                         &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                         NULL\r
                         );\r
       } else {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                         &gEfiComponentNameProtocolGuid,       ComponentName,\r
                         &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -151,14 +157,14 @@ EfiLibInstallAllDriverProtocols (
     if (DriverConfiguration == NULL) {\r
       if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,     DriverBinding,\r
                         &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
                         NULL\r
                         );\r
       } else {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,     DriverBinding,\r
                         &gEfiComponentNameProtocolGuid,     ComponentName,\r
                         &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -168,7 +174,7 @@ EfiLibInstallAllDriverProtocols (
     } else {\r
       if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                         &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                         &gEfiDriverDiagnosticsProtocolGuid,   DriverDiagnostics,\r
@@ -176,7 +182,7 @@ EfiLibInstallAllDriverProtocols (
                         );\r
       } else {\r
         Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
+                        &DriverBinding->DriverBindingHandle,\r
                         &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
                         &gEfiComponentNameProtocolGuid,       ComponentName,\r
                         &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -192,12 +198,6 @@ EfiLibInstallAllDriverProtocols (
   //\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
   return Status;\r
 }\r
 \r
@@ -241,16 +241,22 @@ EfiLibInstallDriverBindingComponentName2 (
 \r
   ASSERT (DriverBinding != NULL);\r
 \r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+\r
   if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
     if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
       Status = gBS->InstallMultipleProtocolInterfaces (\r
-                      &DriverBindingHandle,\r
+                      &DriverBinding->DriverBindingHandle,\r
                       &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                       NULL\r
                       );\r
       } else {\r
       Status = gBS->InstallMultipleProtocolInterfaces (\r
-                      &DriverBindingHandle,\r
+                      &DriverBinding->DriverBindingHandle,\r
                       &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                       &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                       NULL\r
@@ -259,14 +265,14 @@ EfiLibInstallDriverBindingComponentName2 (
   } else {\r
      if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                       &DriverBindingHandle,\r
+                       &DriverBinding->DriverBindingHandle,\r
                        &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                        &gEfiComponentNameProtocolGuid, ComponentName,\r
                        NULL\r
                        );\r
      } else {\r
        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                       &DriverBindingHandle,\r
+                       &DriverBinding->DriverBindingHandle,\r
                        &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                        &gEfiComponentNameProtocolGuid, ComponentName,\r
                        &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -274,17 +280,12 @@ EfiLibInstallDriverBindingComponentName2 (
                        );\r
     }\r
   }\r
+\r
   //\r
   // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
   //\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
   return Status;\r
 }\r
 \r
@@ -338,6 +339,12 @@ EfiLibInstallAllDriverProtocols2 (
 \r
   ASSERT (DriverBinding != NULL); \r
 \r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+  \r
   if (DriverConfiguration2 == NULL) {\r
     if (DriverConfiguration == NULL) {\r
       if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
@@ -345,13 +352,13 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               NULL\r
@@ -360,14 +367,14 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -379,14 +386,14 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
@@ -396,7 +403,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
@@ -404,7 +411,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -419,14 +426,14 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -436,7 +443,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -444,7 +451,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -457,7 +464,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
@@ -465,7 +472,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -476,7 +483,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -485,7 +492,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -503,14 +510,14 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -520,7 +527,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -528,7 +535,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -541,7 +548,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
@@ -549,7 +556,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -560,7 +567,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -569,7 +576,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -585,7 +592,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -593,7 +600,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -604,7 +611,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -613,7 +620,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -627,7 +634,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -636,7 +643,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -648,7 +655,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -658,7 +665,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -679,14 +686,14 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
                               NULL\r
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -696,7 +703,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -704,7 +711,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -717,7 +724,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -725,7 +732,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -736,7 +743,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -745,7 +752,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -761,7 +768,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -769,7 +776,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -780,7 +787,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -789,7 +796,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -803,7 +810,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
                               &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
@@ -812,7 +819,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -824,7 +831,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -834,7 +841,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -853,7 +860,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -861,7 +868,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -872,7 +879,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -881,7 +888,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -895,7 +902,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -904,7 +911,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -916,7 +923,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -926,7 +933,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -943,7 +950,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -952,7 +959,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -964,7 +971,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -974,7 +981,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -989,7 +996,7 @@ EfiLibInstallAllDriverProtocols2 (
           if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
                               &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
@@ -999,7 +1006,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -1012,7 +1019,7 @@ EfiLibInstallAllDriverProtocols2 (
           } else {\r
             if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
@@ -1023,7 +1030,7 @@ EfiLibInstallAllDriverProtocols2 (
                               );\r
             } else {\r
               Status = gBS->InstallMultipleProtocolInterfaces (\r
-                              &DriverBindingHandle,\r
+                              &DriverBinding->DriverBindingHandle,\r
                               &gEfiDriverBindingProtocolGuid, DriverBinding,\r
                               &gEfiComponentNameProtocolGuid, ComponentName,\r
                               &gEfiComponentName2ProtocolGuid, ComponentName2,\r
@@ -1040,19 +1047,10 @@ EfiLibInstallAllDriverProtocols2 (
     }\r
   }\r
 \r
-\r
   //\r
   // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
   //\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
   return Status;\r
 }\r
-\r
-\r