From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=216.228.121.143; helo=hqemgate14.nvidia.com; envelope-from=ashishsingha@nvidia.com; receiver=edk2-devel@lists.01.org Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 753C62194D3B8 for ; Wed, 9 Jan 2019 12:58:52 -0800 (PST) Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 09 Jan 2019 12:58:33 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Wed, 09 Jan 2019 12:58:46 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Wed, 09 Jan 2019 12:58:46 -0800 Received: from HQMAIL102.nvidia.com (172.18.146.10) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 9 Jan 2019 20:58:46 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL102.nvidia.com (172.18.146.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Wed, 9 Jan 2019 20:58:46 +0000 Received: from ashishsingha-lnx.nvidia.com (Not Verified[10.28.48.147]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7, 5, 8, 10121) id ; Wed, 09 Jan 2019 12:58:46 -0800 From: Ashish Singhal To: CC: , , , , Ashish Singhal Date: Wed, 9 Jan 2019 13:58:34 -0700 Message-ID: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-NVConfidentiality: public MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1547067514; bh=UbjP3IlXuRd8LIxG2H5AoqYSnl9v5PnLNkqXI+x1YGQ=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=EweFH2PnMXvgrj+KuTkrse8PG0FuYAwCi/DkBigXpFlWHKkBH871TsqXWMG5prd2O Nzot6n6Fq1hoxn0S3VPBWjhKuJ7/YD/Zqu+cXGAMJbmR9X5LuBl6C2pw4fIL+V3IpY NHvmKh1FKdiEBSeMqtpFm3EjFHMUcUUmTW+e4XZUV+R+i+u/R0hu7tYLtPsbluMv8Y HH5QavUA018iADYf3stChBRDYDr76brsJgu8368udhy6Uh20r42bcRRPr3H28Xf2aU cjtZbQZw8Jh9y+ECG4MVRMTzkO+45MfOd57nQlAccVXre0er29mCjzc/nBIAZF5lO3 wRwGvXSzozNSA== Subject: [PATCH v4 1/2] MdePkg/UefiLib: Abstract driver model protocol uninstallation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2019 20:58:52 -0000 Content-Type: text/plain Provided functions in UEFILib that abstract driver model protocol uninstallation. This helps drivers to install and uninstall protocols using a library to keep things seemless. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1429 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal --- MdePkg/Include/Library/UefiLib.h | 103 ++++ MdePkg/Library/UefiLib/UefiDriverModel.c | 972 ++++++++++++++++++++++++++++++- 2 files changed, 1074 insertions(+), 1 deletion(-) diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h index 468bffc..08222d4 100644 --- a/MdePkg/Include/Library/UefiLib.h +++ b/MdePkg/Include/Library/UefiLib.h @@ -12,6 +12,7 @@ of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is defined, then debug and assert related macros wrapped by it are the NULL implementations. +Copyright (c) 2019, NVIDIA Corporation. All rights reserved. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. @@ -1283,6 +1284,7 @@ AsciiPrintXY ( ... ); + /** Installs and completes the initialization of a Driver Binding Protocol instance. @@ -1316,6 +1318,25 @@ EfiLibInstallDriverBinding ( /** + Uninstalls a Driver Binding Protocol instance. + + If DriverBinding is NULL, then ASSERT(). + If DriverBinding can not be uninstalled, then ASSERT(). + + @param DriverBinding A Driver Binding Protocol instance that this driver produced. + + @retval EFI_SUCCESS The protocol uninstallation successfully completed. + @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). + +**/ +EFI_STATUS +EFIAPI +EfiLibUninstallDriverBinding ( + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding + ); + + +/** Installs and completes the initialization of a Driver Binding Protocol instance and optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols. @@ -1354,6 +1375,31 @@ EfiLibInstallAllDriverProtocols ( ); +/** + Uninstalls a Driver Binding Protocol instance and optionally uninstalls the + Component Name, Driver Configuration and Driver Diagnostics Protocols. + + If DriverBinding is NULL, then ASSERT(). + If the uninstallation fails, then ASSERT(). + + @param DriverBinding A Driver Binding Protocol instance that this driver produced. + @param ComponentName A Component Name Protocol instance that this driver produced. + @param DriverConfiguration A Driver Configuration Protocol instance that this driver produced. + @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver produced. + + @retval EFI_SUCCESS The protocol uninstallation successfully completed. + @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). + +**/ +EFI_STATUS +EFIAPI +EfiLibUninstallAllDriverProtocols ( + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL + IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL + IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL + ); + /** Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols. @@ -1391,6 +1437,29 @@ EfiLibInstallDriverBindingComponentName2 ( /** + Uninstalls Driver Binding Protocol with optional Component Name and Component Name 2 Protocols. + + If DriverBinding is NULL, then ASSERT(). + If the uninstallation fails, then ASSERT(). + + @param DriverBinding A Driver Binding Protocol instance that this driver produced. + @param ComponentName A Component Name Protocol instance that this driver produced. + @param ComponentName2 A Component Name 2 Protocol instance that this driver produced. + + @retval EFI_SUCCESS The protocol installation successfully completed. + @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). + +**/ +EFI_STATUS +EFIAPI +EfiLibUninstallDriverBindingComponentName2 ( + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL + IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL + ); + + +/** Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols. @@ -1434,6 +1503,40 @@ EfiLibInstallAllDriverProtocols2 ( IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL ); + +/** + Uninstalls Driver Binding Protocol with optional Component Name, Component Name 2, Driver + Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols. + + If DriverBinding is NULL, then ASSERT(). + If the installation fails, then ASSERT(). + + + @param DriverBinding A Driver Binding Protocol instance that this driver produced. + @param ComponentName A Component Name Protocol instance that this driver produced. + @param ComponentName2 A Component Name 2 Protocol instance that this driver produced. + @param DriverConfiguration A Driver Configuration Protocol instance that this driver produced. + @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver produced. + @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver produced. + @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver produced. + + @retval EFI_SUCCESS The protocol uninstallation successfully completed. + @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). + +**/ +EFI_STATUS +EFIAPI +EfiLibUninstallAllDriverProtocols2 ( + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL + IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, OPTIONAL + IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL + IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2, OPTIONAL + IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics, OPTIONAL + IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL + ); + + /** Appends a formatted Unicode string to a Null-terminated Unicode string diff --git a/MdePkg/Library/UefiLib/UefiDriverModel.c b/MdePkg/Library/UefiLib/UefiDriverModel.c index 69581ae..262d8bc 100644 --- a/MdePkg/Library/UefiLib/UefiDriverModel.c +++ b/MdePkg/Library/UefiLib/UefiDriverModel.c @@ -1,7 +1,8 @@ /** @file Library functions that abstract driver model protocols - installation. + installation and uninstallation. + Copyright (c) 2019, NVIDIA Corporation. All rights reserved. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -71,6 +72,44 @@ EfiLibInstallDriverBinding ( } + +/** + Uninstalls a Driver Binding Protocol instance. + + If DriverBinding is NULL, then ASSERT(). + If DriverBinding can not be uninstalled, then ASSERT(). + + @param DriverBinding A Driver Binding Protocol instance that this driver produced. + + @retval EFI_SUCCESS The protocol uninstallation successfully completed. + @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). + +**/ +EFI_STATUS +EFIAPI +EfiLibUninstallDriverBinding ( + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding + ) +{ + EFI_STATUS Status; + + ASSERT (DriverBinding != NULL); + + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + NULL + ); + // + // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed + // + ASSERT_EFI_ERROR (Status); + + return Status; +} + + + /** Installs and completes the initialization of a Driver Binding Protocol instance and optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols. @@ -204,6 +243,119 @@ EfiLibInstallAllDriverProtocols ( /** + Uninstalls a Driver Binding Protocol instance and optionally uninstalls the + Component Name, Driver Configuration and Driver Diagnostics Protocols. + + If DriverBinding is NULL, then ASSERT(). + If the uninstallation fails, then ASSERT(). + + @param DriverBinding A Driver Binding Protocol instance that this driver produced. + @param ComponentName A Component Name Protocol instance that this driver produced. + @param DriverConfiguration A Driver Configuration Protocol instance that this driver produced. + @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver produced. + + @retval EFI_SUCCESS The protocol uninstallation successfully completed. + @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). + +**/ +EFI_STATUS +EFIAPI +EfiLibUninstallAllDriverProtocols ( + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL + IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL + IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL + ) +{ + EFI_STATUS Status; + + ASSERT (DriverBinding != NULL); + + if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) { + if (DriverConfiguration == NULL) { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + NULL + ); + } + } else { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + NULL + ); + } + } + } else { + if (DriverConfiguration == NULL) { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } + } else { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } + } + } + + // + // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed + // + ASSERT_EFI_ERROR (Status); + + return Status; +} + + + +/** Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols. Initializes a driver by installing the Driver Binding Protocol together with the @@ -292,6 +444,76 @@ EfiLibInstallDriverBindingComponentName2 ( /** + Uninstalls Driver Binding Protocol with optional Component Name and Component Name 2 Protocols. + + If DriverBinding is NULL, then ASSERT(). + If the uninstallation fails, then ASSERT(). + + @param DriverBinding A Driver Binding Protocol instance that this driver produced. + @param ComponentName A Component Name Protocol instance that this driver produced. + @param ComponentName2 A Component Name 2 Protocol instance that this driver produced. + + @retval EFI_SUCCESS The protocol installation successfully completed. + @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). + +**/ +EFI_STATUS +EFIAPI +EfiLibUninstallDriverBindingComponentName2 ( + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL + IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL + ) +{ + EFI_STATUS Status; + + ASSERT (DriverBinding != NULL); + + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + NULL + ); + } + } + + // + // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed + // + ASSERT_EFI_ERROR (Status); + + return Status; +} + + + +/** Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols. @@ -1054,3 +1276,751 @@ EfiLibInstallAllDriverProtocols2 ( return Status; } + + + +/** + Uninstalls Driver Binding Protocol with optional Component Name, Component Name 2, Driver + Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols. + + If DriverBinding is NULL, then ASSERT(). + If the installation fails, then ASSERT(). + + + @param DriverBinding A Driver Binding Protocol instance that this driver produced. + @param ComponentName A Component Name Protocol instance that this driver produced. + @param ComponentName2 A Component Name 2 Protocol instance that this driver produced. + @param DriverConfiguration A Driver Configuration Protocol instance that this driver produced. + @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver produced. + @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver produced. + @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver produced. + + @retval EFI_SUCCESS The protocol uninstallation successfully completed. + @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). + +**/ +EFI_STATUS +EFIAPI +EfiLibUninstallAllDriverProtocols2 ( + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL + IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, OPTIONAL + IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL + IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2, OPTIONAL + IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics, OPTIONAL + IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL + ) +{ + EFI_STATUS Status; + + ASSERT (DriverBinding != NULL); + + if (DriverConfiguration2 == NULL) { + if (DriverConfiguration == NULL) { + if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) { + if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + NULL + ); + } + } + } else { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } + } + } else { + if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } + } + } else { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } + } + } + } else { + if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) { + if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + NULL + ); + } + } + } else { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } + } + } else { + if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } + } + } else { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } + } + } + } + } else { + if (DriverConfiguration == NULL) { + if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) { + if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + NULL + ); + } + } + } else { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } + } + } else { + if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } + } + } else { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } + } + } + } else { + if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) { + if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + NULL + ); + } + } + } else { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } + } + } else { + if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + NULL + ); + } + } + } else { + if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } else { + if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } else { + Status = gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, DriverBinding, + &gEfiComponentNameProtocolGuid, ComponentName, + &gEfiComponentName2ProtocolGuid, ComponentName2, + &gEfiDriverConfigurationProtocolGuid, DriverConfiguration, + &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2, + &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics, + &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2, + NULL + ); + } + } + } + } + } + } + + // + // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed + // + ASSERT_EFI_ERROR (Status); + + return Status; +} -- 2.7.4