From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=203.18.50.4; helo=nat-hk.nvidia.com; envelope-from=ashishsingha@nvidia.com; receiver=edk2-devel@lists.01.org Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) (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 73EDA208AE35F for ; Tue, 19 Feb 2019 08:19:28 -0800 (PST) Received: from hkpgpgate102.nvidia.com (Not Verified[10.18.92.100]) by nat-hk.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 20 Feb 2019 00:19:26 +0800 Received: from HKMAIL102.nvidia.com ([10.18.16.11]) by hkpgpgate102.nvidia.com (PGP Universal service); Tue, 19 Feb 2019 08:19:26 -0800 X-PGP-Universal: processed; by hkpgpgate102.nvidia.com on Tue, 19 Feb 2019 08:19:26 -0800 Received: from HKMAIL102.nvidia.com (10.18.16.11) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 19 Feb 2019 16:19:25 +0000 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (104.47.40.53) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 19 Feb 2019 16:19:24 +0000 Received: from DM6PR12MB3324.namprd12.prod.outlook.com (20.178.31.154) by DM6PR12MB3370.namprd12.prod.outlook.com (20.178.198.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.20; Tue, 19 Feb 2019 16:19:02 +0000 Received: from DM6PR12MB3324.namprd12.prod.outlook.com ([fe80::f8d4:91e2:b81b:3b81]) by DM6PR12MB3324.namprd12.prod.outlook.com ([fe80::f8d4:91e2:b81b:3b81%4]) with mapi id 15.20.1622.020; Tue, 19 Feb 2019 16:19:02 +0000 From: Ashish Singhal To: "edk2-devel@lists.01.org" CC: "michael.d.kinney@intel.com" , "liming.gao@intel.com" Thread-Topic: [PATCH] MdePkg/UefiLib: Simplify protocol un/installation abstraction Thread-Index: AQHUvMUdlWJixMqlykee1TFuocd2D6XnZABA Date: Tue, 19 Feb 2019 16:19:02 +0000 Message-ID: References: <9c850690f22cc52a348211f28b6c1c8d0b9c47c2.1549310714.git.ashishsingha@nvidia.com> In-Reply-To: <9c850690f22cc52a348211f28b6c1c8d0b9c47c2.1549310714.git.ashishsingha@nvidia.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Enabled=True; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SiteId=43083d15-7273-40c1-b7db-39efd9ccc17a; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Owner=ashishsingha@nvidia.com; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SetDate=2019-02-19T16:18:59.6993159Z; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Name=Unrestricted; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Application=Microsoft Azure Information Protection; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Extended_MSFT_Method=Automatic; Sensitivity=Unrestricted authentication-results: spf=none (sender IP is ) smtp.mailfrom=ashishsingha@nvidia.com; x-originating-ip: [216.228.112.22] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2c9a97cc-3a2a-436c-87df-08d69685f62e x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600110)(711020)(4605104)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DM6PR12MB3370; x-ms-traffictypediagnostic: DM6PR12MB3370: x-microsoft-exchange-diagnostics: =?us-ascii?Q?1; DM6PR12MB3370; 23:WmJLur5V+8ufQdvbzUF58pEdWJ8kgZ4HDTY9rrCxc?= =?us-ascii?Q?Q8Ejo16M9Oun7hBep1iY3BlHgoanoiAaWc/e3ChFG1iTz6QMb2zOmsYJb+8H?= =?us-ascii?Q?zXrfyFAPkETADOIAYDQ2rWaNFWxzyMpGt8TWh8CrMEgDJ6AUlfIeD5zW82Qf?= =?us-ascii?Q?wxt0WD7t6I/X33o2I7WSx5bU2l8wq0Naz/TisGg79kaGVIf2NpMPIgX8JbzM?= =?us-ascii?Q?fCb8BRDqdGz8MD9BUI3TvW1T1dIqQwb1Vff4+db41NsxSi4oDC+rdMeIpdED?= =?us-ascii?Q?8YsYDKVuEntqb0UxANmFDEakJKJ9zpDBx0VgZjPv6WtbDMlVGcIml4lmyBj4?= =?us-ascii?Q?osWk5Vw9NHbgXeKKZt7nbJkaWhYozodax6NJ67WNJDd5B5nyECwPfeszWiV8?= =?us-ascii?Q?bsNMfima+KIULcOyfOEYEaASBJQeKG+ae1Tzuw4MPApUgNJyUKPbrGHvodEc?= =?us-ascii?Q?ogUXA7HAvUluF+KWAMcPGxb3JFyeVKzxUJcKK7kVI5eaEIKX3upv6o5zMpo3?= =?us-ascii?Q?b1+qpVsCZFYk5P6hhZtqXXObh35i2XvuNweZYJefQUXdHb2wktNwKRqADdgU?= =?us-ascii?Q?ab9TVvPpr0it9kSGPnWK4b8BzWZghipvOXPiM2Jrd77MZirwU6GPBY/T6zRv?= =?us-ascii?Q?08HYj3Ty2eaotJtrm50HRLRiHAduRg6ekPMdWkkjeTWGGVzX65kSb+b6YWLB?= =?us-ascii?Q?xf7yQD+ZJmh3fATqzuBASmPXkYdsudPRqZuqZvbU3xELW1ViUfyFLc/muPZp?= =?us-ascii?Q?3USqhXiwM385tcwalfFrft1D9w7tXV2L/d3YnfUS/ovOohw6+kzlAyXTF5bd?= =?us-ascii?Q?akhlSZDt5eMsBd/rwmVlfSUbHTRWbn16gi+eLt97rQXVszILpdw+x0a5ZrQ/?= =?us-ascii?Q?ECztfaO5qnAkXNU5++GoWQ3Bfcik8MJ5v5RbpC8XzSs/MCybcwsdOwuslEQS?= =?us-ascii?Q?GpIQjmY9PIvIv9eTk1lJX6oqvGgbNwjW7cBDwl0txgWb7qNIugCcrs/ujnOR?= =?us-ascii?Q?w0KHwdrSE0q7zgzZrLoF1bZf2UYu5xXazSDXxmRsl0nwzKkO7/UAo5l8rSM/?= =?us-ascii?Q?ZWzGMbDrfn9bp7BAIxClTm+sLKzoNWcIU/IUYosuPpSksbDr4Ty51rd1R/VJ?= =?us-ascii?Q?AJ1zMQbej/M33z465wNjVD+OWnypiesnLo7C0cvOg6AkxaqUCbXgDk1dLSfO?= =?us-ascii?Q?NLYukhuyGcCrdrF+9r/egjoTU9u/FgU0SnRfeoBsd5yYGjBwngykgq4mmYnJ?= =?us-ascii?Q?dLvmpefHBSaJxt7uHumb4SBCx/pAWjLt9wMD6+wXYXZkHkrgEewV5RtkZq0V?= =?us-ascii?Q?EzKdiZrmLIvMZuFV7a/NS/RBX0bHdWqjH1UChrRVoCf70pTDxyORS1ePgjRi?= =?us-ascii?Q?cJKdRTBC8Bghk3ug2RuErMGjWjr1p6w9tMCcQfCf9bfmJ23u6tVq9P+/NKQ/?= =?us-ascii?Q?LFPHuYI/Q=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09538D3531 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(136003)(39860400002)(366004)(396003)(346002)(13464003)(199004)(189003)(66066001)(7736002)(68736007)(305945005)(25786009)(99286004)(478600001)(30864003)(53936002)(53946003)(81156014)(8936002)(81166006)(8676002)(9686003)(55016002)(5640700003)(76176011)(6436002)(316002)(54906003)(71200400001)(71190400001)(4326008)(7696005)(6916009)(5660300002)(19627235002)(256004)(229853002)(86362001)(102836004)(476003)(186003)(14444005)(2906002)(3846002)(6116002)(2501003)(6246003)(74316002)(33656002)(14454004)(6506007)(11346002)(2351001)(446003)(486006)(105586002)(106356001)(53546011)(97736004)(26005)(559001)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB3370; H:DM6PR12MB3324.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ESF9oA5BNTpP2LVavvFUaeg9GJ6UiOyGLJFfNGOss0rEDuAx3nU9EyKKPKjv2a43CDj1S+2P2FaDtLTZPJIMZeGDAJxOy3rSddNlmY07VT4RJfOI2XsamxkV6csGnZRd6kSC7yr+32f90FtliOtQEil5mEuazOPCAaGyTfoQf/fE6akhlntCo7Nwiy4OrbqxevPJG/caAqGIHnwaKWpGUaou6ixWFSAVvOYwxwWH+wC5CgbOdK7v6rmT0ImmYt/7QrmJKivQGGMrguZLveRzsbEb4HDzxPDyndKTz6ZanY98zcW7DET1/PBLyF9qYj2a3zb09Iy76j+5kdg1xbk3u+nYFWksDwyNtBPclWkaT4HEWn1jhW7SXFX7WKNT43MaXIQU3PE0eN6as0zq91GhWGH4ItnyzMm3fwI5xS+dG4s= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2c9a97cc-3a2a-436c-87df-08d69685f62e X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2019 16:19:02.3534 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3370 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1550593167; bh=Y/YjxO0xGGj5km3cqiEDoOQtWHsSlJf7V089MaWFnB4=; h=X-PGP-Universal:From:To:CC:Subject:Thread-Topic:Thread-Index:Date: Message-ID:References:In-Reply-To:Accept-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:msip_labels:authentication-results: x-originating-ip:x-ms-publictraffictype: x-ms-office365-filtering-correlation-id:x-microsoft-antispam: x-ms-traffictypediagnostic:x-microsoft-exchange-diagnostics: x-microsoft-antispam-prvs:x-forefront-prvs: x-forefront-antispam-report:received-spf: x-ms-exchange-senderadcheck:x-microsoft-antispam-message-info: MIME-Version:X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg: Content-Language:Content-Type:Content-Transfer-Encoding; b=RUxIfNLzGZQdJ/s7xck0KjIACF37NuGa5TehFBjHuuChmvNKpqvBwCIeZwRFeVN9e uETqWTuOcZzxg1n0EVbjt0nxiJC6aM4gmHhO2ghZCJYTgwyHhS/w47fB4Amk8bhjqV +iWwfR1sIcJD8tj56IUO+2GGOS5x8+3igcRF6HZ8qW7GKtNGACrH4eTL1LG/phuble 03mSl2LIgyNtnb+QjAmznGc7Zyov1iV69Y2rPZDScsOigBT71G4tlNssanqnpHjaVc YqwnS5/s4Myi2jIjar7A3qZZhFWeVsNOUY1+LypIZe8Gslnx3836KAO7ceKJdMeWGo eEZE8bzwA8s9g== Subject: Re: [PATCH] MdePkg/UefiLib: Simplify protocol un/installation abstraction 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: Tue, 19 Feb 2019 16:19:30 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Mike/Lao, Were you able to have a look at this? Thanks Ashish -----Original Message----- From: Ashish Singhal =20 Sent: Monday, February 4, 2019 1:16 PM To: edk2-devel@lists.01.org Cc: michael.d.kinney@intel.com; liming.gao@intel.com; Ashish Singhal Subject: [PATCH] MdePkg/UefiLib: Simplify protocol un/installation abstra= ction Add helper functions to operate upon protocol installation and uninstallation instead of every function doing it by itself. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal --- =20MdePkg/Library/UefiLib/UefiDriverModel.c | 2040 +++++-----------------= -------- =201 file changed, 342 insertions(+), 1698 deletions(-) diff --git a/MdePkg/Library/UefiLib/UefiDriverModel.c b/MdePkg/Library/Ue= fiLib/UefiDriverModel.c index 262d8bc..268edf7 100644 --- a/MdePkg/Library/UefiLib/UefiDriverModel.c +++ b/MdePkg/Library/UefiLib/UefiDriverModel.c @@ -17,6 +17,290 @@ =20 =20#include "UefiLibInternal.h" =20 + +#define MAX_SUPPORTED_PROTOCOLS 7 +typedef struct { + EFI_GUID *Guid; + VOID *Interface; +} EFI_PROCESS_PROTOCOL; + + +static +EFI_STATUS +EFIAPI +EfiLibProcessProtocols ( + IN CONST EFI_HANDLE ImageHandle, + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN EFI_HANDLE DriverBindingHandle, + IN BOOLEAN Install, + IN CONST EFI_PROCESS_PROTOCOL *ProtocolArray + ) +{ + ASSERT (DriverBinding !=3D NULL); + ASSERT (ProtocolArray !=3D NULL); + + if (Install) { + // + // Update the ImageHandle and DriverBindingHandle fields of the Driv= er Binding Protocol + // + DriverBinding->ImageHandle =3D ImageHandle; + DriverBinding->DriverBindingHandle =3D DriverBindingHandle; + + return gBS->InstallMultipleProtocolInterfaces ( + &DriverBinding->DriverBindingHandle, + ProtocolArray[0].Guid, ProtocolArray[0].Interface, + ProtocolArray[1].Guid, ProtocolArray[1].Interface, + ProtocolArray[2].Guid, ProtocolArray[2].Interface, + ProtocolArray[3].Guid, ProtocolArray[3].Interface, + ProtocolArray[4].Guid, ProtocolArray[4].Interface, + ProtocolArray[5].Guid, ProtocolArray[5].Interface, + ProtocolArray[6].Guid, ProtocolArray[6].Interface, + NULL + ); + } else { + return gBS->UninstallMultipleProtocolInterfaces ( + DriverBinding->DriverBindingHandle, + ProtocolArray[0].Guid, ProtocolArray[0].Interface, + ProtocolArray[1].Guid, ProtocolArray[1].Interface, + ProtocolArray[2].Guid, ProtocolArray[2].Interface, + ProtocolArray[3].Guid, ProtocolArray[3].Interface, + ProtocolArray[4].Guid, ProtocolArray[4].Interface, + ProtocolArray[5].Guid, ProtocolArray[5].Interface, + ProtocolArray[6].Guid, ProtocolArray[6].Interface, + NULL + ); + } +} + + + +static +EFI_STATUS +EFIAPI +EfiLibProcessAllDriverProtocols ( + IN CONST EFI_HANDLE ImageHandle, + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN EFI_HANDLE DriverBindingHandle, + IN BOOLEAN Install, + IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, + IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, + IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics + ) +{ + EFI_STATUS Status; + EFI_PROCESS_PROTOCOL ProtocolArray[MAX_SUPPORTED_PROTOCOLS]; + UINT8 ProtocolCount; + + ASSERT (DriverBinding !=3D NULL); + + // + // ZI the ProtocolArray structure. Both InstallMultipleProtocolInterfa= ces + // and UninstallMultipleProtocolInterfaces would stop processing Proto= colArray + // elements as soon as they encounter a NULL. + // + ZeroMem(ProtocolArray, sizeof(ProtocolArray)); + ProtocolCount =3D 0; + + // + // Populate ProtocolArray with valid protocol interfaces. + // + ProtocolArray[ProtocolCount].Guid =3D &gEfiDriverBindingProtocolGuid; + ProtocolArray[ProtocolCount].Interface =3D DriverBinding; + ProtocolCount++; + + if (ComponentName !=3D NULL && !FeaturePcdGet(PcdComponentNameDisable)= ) { + ProtocolArray[ProtocolCount].Guid =3D &gEfiComponentNameProtocolGuid= ; + ProtocolArray[ProtocolCount].Interface =3D (VOID *)ComponentName; + ProtocolCount++; + } + + if (DriverConfiguration !=3D NULL) { + ProtocolArray[ProtocolCount].Guid =3D &gEfiDriverConfigurationProtoc= olGuid; + ProtocolArray[ProtocolCount].Interface =3D (VOID *)DriverConfigurati= on; + ProtocolCount++; + } + + if (DriverDiagnostics !=3D NULL && !FeaturePcdGet(PcdDriverDiagnostics= Disable)) { + ProtocolArray[ProtocolCount].Guid =3D &gEfiDriverDiagnosticsProtocol= Guid; + ProtocolArray[ProtocolCount].Interface =3D (VOID *)DriverDiagnostics= ; + ProtocolCount++; + } + + Status =3D EfiLibProcessProtocols ( + ImageHandle, + DriverBinding, + DriverBindingHandle, + Install, + ProtocolArray + ); + + // + // ASSERT if the call to InstallMultipleProtocolInterfaces() or + // UninstallMultipleProtocolInterfaces() failed + // + ASSERT_EFI_ERROR (Status); + + return Status; +} + + + +static +EFI_STATUS +EFIAPI +EfiLibProcessDriverBindingComponentName2 ( + IN CONST EFI_HANDLE ImageHandle, + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN EFI_HANDLE DriverBindingHandle, + IN BOOLEAN Install, + IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, + IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 + ) +{ + EFI_STATUS Status; + EFI_PROCESS_PROTOCOL ProtocolArray[MAX_SUPPORTED_PROTOCOLS]; + UINT8 ProtocolCount; + + ASSERT (DriverBinding !=3D NULL); + + // + // ZI the ProtocolArray structure. Both InstallMultipleProtocolInterfa= ces + // and UninstallMultipleProtocolInterfaces would stop processing Proto= colArray + // elements as soon as they encounter a NULL. + // + ZeroMem(ProtocolArray, sizeof(ProtocolArray)); + ProtocolCount =3D 0; + + // + // Populate ProtocolArray with valid protocol interfaces. + // + ProtocolArray[ProtocolCount].Guid =3D &gEfiDriverBindingProtocolGuid; + ProtocolArray[ProtocolCount].Interface =3D DriverBinding; + ProtocolCount++; + + if (ComponentName !=3D NULL && !FeaturePcdGet(PcdComponentNameDisable)= ) { + ProtocolArray[ProtocolCount].Guid =3D &gEfiComponentNameProtocolGuid= ; + ProtocolArray[ProtocolCount].Interface =3D (VOID *)ComponentName; + ProtocolCount++; + } + + if (ComponentName2 !=3D NULL && !FeaturePcdGet(PcdComponentName2Disabl= e)) { + ProtocolArray[ProtocolCount].Guid =3D &gEfiComponentName2ProtocolGui= d; + ProtocolArray[ProtocolCount].Interface =3D (VOID *)ComponentName2; + ProtocolCount++; + } + + Status =3D EfiLibProcessProtocols ( + ImageHandle, + DriverBinding, + DriverBindingHandle, + Install, + ProtocolArray + ); + + // + // ASSERT if the call to InstallMultipleProtocolInterfaces() or + // UninstallMultipleProtocolInterfaces() failed + // + ASSERT_EFI_ERROR (Status); + + return Status; +} + + + +static +EFI_STATUS +EFIAPI +EfiLibProcessAllDriverProtocols2 ( + IN CONST EFI_HANDLE ImageHandle, + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN EFI_HANDLE DriverBindingHandle, + IN BOOLEAN Install, + IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, + IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, + IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, + IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2, + IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics, + IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 + ) +{ + EFI_STATUS Status; + EFI_PROCESS_PROTOCOL ProtocolArray[MAX_SUPPORTED_PROTOCOLS]; + UINT8 ProtocolCount; + + ASSERT (DriverBinding !=3D NULL); + + // + // ZI the ProtocolArray structure. Both InstallMultipleProtocolInterfa= ces + // and UninstallMultipleProtocolInterfaces would stop processing Proto= colArray + // elements as soon as they encounter a NULL. + // + ZeroMem(ProtocolArray, sizeof(ProtocolArray)); + ProtocolCount =3D 0; + + // + // Populate ProtocolArray with valid protocol interfaces. + // + ProtocolArray[ProtocolCount].Guid =3D &gEfiDriverBindingProtocolGuid; + ProtocolArray[ProtocolCount].Interface =3D DriverBinding; + ProtocolCount++; + + if (ComponentName !=3D NULL && !FeaturePcdGet(PcdComponentNameDisable)= ) { + ProtocolArray[ProtocolCount].Guid =3D &gEfiComponentNameProtocolGuid= ; + ProtocolArray[ProtocolCount].Interface =3D (VOID *)ComponentName; + ProtocolCount++; + } + + if (ComponentName2 !=3D NULL && !FeaturePcdGet(PcdComponentName2Disabl= e)) { + ProtocolArray[ProtocolCount].Guid =3D &gEfiComponentName2ProtocolGui= d; + ProtocolArray[ProtocolCount].Interface =3D (VOID *)ComponentName2; + ProtocolCount++; + } + + if (DriverConfiguration !=3D NULL) { + ProtocolArray[ProtocolCount].Guid =3D &gEfiDriverConfigurationProtoc= olGuid; + ProtocolArray[ProtocolCount].Interface =3D (VOID *)DriverConfigurati= on; + ProtocolCount++; + } + + if (DriverConfiguration2 !=3D NULL) { + ProtocolArray[ProtocolCount].Guid =3D &gEfiDriverConfiguration2Proto= colGuid; + ProtocolArray[ProtocolCount].Interface =3D (VOID *)DriverConfigurati= on2; + ProtocolCount++; + } + + if (DriverDiagnostics !=3D NULL && !FeaturePcdGet(PcdDriverDiagnostics= Disable)) { + ProtocolArray[ProtocolCount].Guid =3D &gEfiDriverDiagnosticsProtocol= Guid; + ProtocolArray[ProtocolCount].Interface =3D (VOID *)DriverDiagnostics= ; + ProtocolCount++; + } + + if (DriverDiagnostics2 !=3D NULL && !FeaturePcdGet(PcdDriverDiagnostic= s2Disable)) { + ProtocolArray[ProtocolCount].Guid =3D &gEfiDriverDiagnostics2Protoco= lGuid; + ProtocolArray[ProtocolCount].Interface =3D (VOID *)DriverDiagnostics= 2; + ProtocolCount++; + } + + Status =3D EfiLibProcessProtocols ( + ImageHandle, + DriverBinding, + DriverBindingHandle, + Install, + ProtocolArray + ); + + // + // ASSERT if the call to InstallMultipleProtocolInterfaces() or + // UninstallMultipleProtocolInterfaces() failed + // + ASSERT_EFI_ERROR (Status); + + return Status; +} + + + =20/** =20 Installs and completes the initialization of a Driver Binding Protoc= ol instance. =20 @@ -148,96 +432,15 @@ EfiLibInstallAllDriverProtocols ( =20 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OP= TIONAL =20 ) =20{ - EFI_STATUS Status; - - ASSERT (DriverBinding !=3D NULL); - - // - // Update the ImageHandle and DriverBindingHandle fields of the Driver= =20Binding Protocol - // - DriverBinding->ImageHandle =3D ImageHandle; - DriverBinding->DriverBindingHandle =3D DriverBindingHandle; - - if (DriverDiagnostics =3D=3D NULL || FeaturePcdGet(PcdDriverDiagnostic= sDisable)) { - if (DriverConfiguration =3D=3D NULL) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNameDis= able)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - &gEfiComponentNameProtocolGuid, ComponentName, - NULL - ); - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNameDis= able)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, DriverConf= iguration, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, DriverConf= iguration, - NULL - ); - } - } - } else { - if (DriverConfiguration =3D=3D NULL) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNameDis= able)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBindin= g, - &gEfiDriverDiagnosticsProtocolGuid, DriverDiagno= stics, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBindin= g, - &gEfiComponentNameProtocolGuid, ComponentNam= e, - &gEfiDriverDiagnosticsProtocolGuid, DriverDiagno= stics, - NULL - ); - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNameDis= able)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, DriverConf= iguration, - &gEfiDriverDiagnosticsProtocolGuid, DriverDiag= nostics, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, DriverConf= iguration, - &gEfiDriverDiagnosticsProtocolGuid, DriverDiag= nostics, - NULL - ); - } - } - } - - // - // ASSERT if the call to InstallMultipleProtocolInterfaces() failed - // - ASSERT_EFI_ERROR (Status); - - return Status; + return EfiLibProcessAllDriverProtocols ( + ImageHandle, + DriverBinding, + DriverBindingHandle, + TRUE, + ComponentName, + DriverConfiguration, + DriverDiagnostics + ); =20} =20 =20 @@ -267,90 +470,15 @@ EfiLibUninstallAllDriverProtocols ( =20 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OP= TIONAL =20 ) =20{ - EFI_STATUS Status; - - ASSERT (DriverBinding !=3D NULL); - - if (DriverDiagnostics =3D=3D NULL || FeaturePcdGet(PcdDriverDiagnostic= sDisable)) { - if (DriverConfiguration =3D=3D NULL) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNameDis= able)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - &gEfiComponentNameProtocolGuid, ComponentName, - NULL - ); - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNameDis= able)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, DriverConf= iguration, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, DriverConf= iguration, - NULL - ); - } - } - } else { - if (DriverConfiguration =3D=3D NULL) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNameDis= able)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBindin= g, - &gEfiDriverDiagnosticsProtocolGuid, DriverDiagno= stics, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBindin= g, - &gEfiComponentNameProtocolGuid, ComponentNam= e, - &gEfiDriverDiagnosticsProtocolGuid, DriverDiagno= stics, - NULL - ); - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNameDis= able)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, DriverConf= iguration, - &gEfiDriverDiagnosticsProtocolGuid, DriverDiag= nostics, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, DriverConf= iguration, - &gEfiDriverDiagnosticsProtocolGuid, DriverDiag= nostics, - NULL - ); - } - } - } - - // - // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed - // - ASSERT_EFI_ERROR (Status); - - return Status; + return EfiLibProcessAllDriverProtocols ( + NULL, + DriverBinding, + NULL, + FALSE, + ComponentName, + DriverConfiguration, + DriverDiagnostics + ); =20} =20 =20 @@ -389,56 +517,14 @@ EfiLibInstallDriverBindingComponentName2 ( =20 IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OP= TIONAL =20 ) =20{ - EFI_STATUS Status; - - ASSERT (DriverBinding !=3D NULL); - - // - // Update the ImageHandle and DriverBindingHandle fields of the Driver= =20Binding Protocol - // - DriverBinding->ImageHandle =3D ImageHandle; - DriverBinding->DriverBindingHandle =3D DriverBindingHandle; - - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNameDisable= )) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponentName2Dis= able)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - &gEfiComponentName2ProtocolGuid, ComponentName2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponentName2Di= sable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - &gEfiComponentNameProtocolGuid, ComponentName, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - &gEfiComponentNameProtocolGuid, ComponentName, - &gEfiComponentName2ProtocolGuid, ComponentName2, - NULL - ); - } - } - - // - // ASSERT if the call to InstallMultipleProtocolInterfaces() failed - // - ASSERT_EFI_ERROR (Status); - - return Status; + return EfiLibProcessDriverBindingComponentName2 ( + ImageHandle, + DriverBinding, + DriverBindingHandle, + TRUE, + ComponentName, + ComponentName2 + ); =20} =20 =20 @@ -465,50 +551,14 @@ EfiLibUninstallDriverBindingComponentName2 ( =20 IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OP= TIONAL =20 ) =20{ - EFI_STATUS Status; - - ASSERT (DriverBinding !=3D NULL); - - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNameDisable= )) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponentName2Dis= able)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - &gEfiComponentName2ProtocolGuid, ComponentName2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponentName2Di= sable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - &gEfiComponentNameProtocolGuid, ComponentName, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBinding, - &gEfiComponentNameProtocolGuid, ComponentName, - &gEfiComponentName2ProtocolGuid, ComponentName2, - NULL - ); - } - } - - // - // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed - // - ASSERT_EFI_ERROR (Status); - - return Status; + return EfiLibProcessDriverBindingComponentName2 ( + NULL, + DriverBinding, + NULL, + FALSE, + ComponentName, + ComponentName2 + ); =20} =20 =20 @@ -557,724 +607,18 @@ EfiLibInstallAllDriverProtocols2 ( =20 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 O= PTIONAL =20 ) =20{ - EFI_STATUS Status; - - ASSERT (DriverBinding !=3D NULL); - - // - // Update the ImageHandle and DriverBindingHandle fields of the Driver= =20Binding Protocol - // - DriverBinding->ImageHandle =3D ImageHandle; - DriverBinding->DriverBindingHandle =3D DriverBindingHandle; - - if (DriverConfiguration2 =3D=3D NULL) { - if (DriverConfiguration =3D=3D NULL) { - if (DriverDiagnostics =3D=3D NULL || FeaturePcdGet(PcdDriverDiagno= sticsDisable)) { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } else { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } - } else { - if (DriverDiagnostics =3D=3D NULL || FeaturePcdGet(PcdDriverDiagno= sticsDisable)) { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } else { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } - } - } else { - if (DriverConfiguration =3D=3D NULL) { - if (DriverDiagnostics =3D=3D NULL || FeaturePcdGet(PcdDriverDiagno= sticsDisable)) { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } else { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } - } else { - if (DriverDiagnostics =3D=3D NULL || FeaturePcdGet(PcdDriverDiagno= sticsDisable)) { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } else { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } - } - } - - // - // ASSERT if the call to InstallMultipleProtocolInterfaces() failed - // - ASSERT_EFI_ERROR (Status); - - return Status; + return EfiLibProcessAllDriverProtocols2 ( + ImageHandle, + DriverBinding, + DriverBindingHandle, + TRUE, + ComponentName, + ComponentName2, + DriverConfiguration, + DriverConfiguration2, + DriverDiagnostics, + DriverDiagnostics2 + ); =20} =20 =20 @@ -1311,716 +655,16 @@ EfiLibUninstallAllDriverProtocols2 ( =20 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 O= PTIONAL =20 ) =20{ - EFI_STATUS Status; - - ASSERT (DriverBinding !=3D NULL); - - if (DriverConfiguration2 =3D=3D NULL) { - if (DriverConfiguration =3D=3D NULL) { - if (DriverDiagnostics =3D=3D NULL || FeaturePcdGet(PcdDriverDiagno= sticsDisable)) { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } else { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } - } else { - if (DriverDiagnostics =3D=3D NULL || FeaturePcdGet(PcdDriverDiagno= sticsDisable)) { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } else { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } - } - } else { - if (DriverConfiguration =3D=3D NULL) { - if (DriverDiagnostics =3D=3D NULL || FeaturePcdGet(PcdDriverDiagno= sticsDisable)) { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } else { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } - } else { - if (DriverDiagnostics =3D=3D NULL || FeaturePcdGet(PcdDriverDiagno= sticsDisable)) { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } else { - if (DriverDiagnostics2 =3D=3D NULL || FeaturePcdGet(PcdDriverDia= gnostics2Disable)) { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - NULL - ); - } - } - } else { - if (ComponentName =3D=3D NULL || FeaturePcdGet(PcdComponentNam= eDisable)) { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } else { - if (ComponentName2 =3D=3D NULL || FeaturePcdGet(PcdComponent= Name2Disable)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - DriverBinding->DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, DriverBind= ing, - &gEfiComponentNameProtocolGuid, ComponentN= ame, - &gEfiComponentName2ProtocolGuid, Component= Name2, - &gEfiDriverConfigurationProtocolGuid, Driv= erConfiguration, - &gEfiDriverConfiguration2ProtocolGuid, Dri= verConfiguration2, - &gEfiDriverDiagnosticsProtocolGuid, Driver= Diagnostics, - &gEfiDriverDiagnostics2ProtocolGuid, Drive= rDiagnostics2, - NULL - ); - } - } - } - } - } - } - - // - // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed - // - ASSERT_EFI_ERROR (Status); - - return Status; + return EfiLibProcessAllDriverProtocols2 ( + NULL, + DriverBinding, + NULL, + FALSE, + ComponentName, + ComponentName2, + DriverConfiguration, + DriverConfiguration2, + DriverDiagnostics, + DriverDiagnostics2 + ); =20} --=20 2.7.4 -------------------------------------------------------------------------= ---------- This email message is for the sole use of the intended recipient(s) and m= ay contain confidential information. Any unauthorized review, use, disclosure or di= stribution is prohibited. If you are not the intended recipient, please contact the= =20sender by reply email and destroy all copies of the original message. -------------------------------------------------------------------------= ----------