2 Library functions that abstract driver model protocols
5 Copyright (c) 2006 - 2007, Intel Corporation<BR> All rights
6 reserved. This program and the accompanying materials are
7 licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 // Include common header file for this module.
19 #include "UefiLibInternal.h"
22 Intialize a driver by installing the Driver Binding Protocol onto the driver's
23 DriverBindingHandle. This is typically the same as the driver's ImageHandle, but
24 it can be different if the driver produces multiple DriverBinding Protocols.
25 If the Drvier Binding Protocol interface is NULL, then ASSERT ().
26 If the installation fails, then ASSERT ().
28 @param ImageHandle The image handle of the driver.
29 @param SystemTable The EFI System Table that was passed to the driver's entry point.
30 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
31 @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
32 parameter is NULL, then a new handle is created.
34 @retval EFI_SUCCESS The protocol installation is completed successfully.
35 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
40 EfiLibInstallDriverBinding (
41 IN CONST EFI_HANDLE ImageHandle
,
42 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
43 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
44 IN EFI_HANDLE DriverBindingHandle
49 ASSERT (NULL
!= DriverBinding
);
51 Status
= gBS
->InstallMultipleProtocolInterfaces (
53 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
57 // ASSERT if the call to InstallMultipleProtocolInterfaces() failed
59 ASSERT_EFI_ERROR (Status
);
62 // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol
64 DriverBinding
->ImageHandle
= ImageHandle
;
65 DriverBinding
->DriverBindingHandle
= DriverBindingHandle
;
72 Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,
73 Driver Configure and Driver Diagnostic Protocols onto the driver's DriverBindingHandle. This is
74 typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple
75 DriverBinding Protocols.
76 If the Drvier Binding Protocol interface is NULL, then ASSERT ().
77 If the installation fails, then ASSERT ().
79 @param ImageHandle The image handle of the driver.
80 @param SystemTable The EFI System Table that was passed to the driver's entry point.
81 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
82 @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
83 parameter is NULL, then a new handle is created.
84 @param ComponentName A Component Name Protocol instance that this driver is producing.
85 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
86 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
88 @retval EFI_SUCCESS The protocol installation is completed successfully.
89 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
94 EfiLibInstallAllDriverProtocols (
95 IN CONST EFI_HANDLE ImageHandle
,
96 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
97 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
98 IN EFI_HANDLE DriverBindingHandle
,
99 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
100 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
101 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics OPTIONAL
106 ASSERT (NULL
!= DriverBinding
);
108 if (DriverDiagnostics
== NULL
|| FeaturePcdGet(PcdDriverDiagnosticsDisable
)) {
109 if (DriverConfiguration
== NULL
) {
110 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
111 Status
= gBS
->InstallMultipleProtocolInterfaces (
112 &DriverBindingHandle
,
113 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
117 Status
= gBS
->InstallMultipleProtocolInterfaces (
118 &DriverBindingHandle
,
119 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
120 &gEfiComponentNameProtocolGuid
, ComponentName
,
125 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
126 Status
= gBS
->InstallMultipleProtocolInterfaces (
127 &DriverBindingHandle
,
128 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
129 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
133 Status
= gBS
->InstallMultipleProtocolInterfaces (
134 &DriverBindingHandle
,
135 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
136 &gEfiComponentNameProtocolGuid
, ComponentName
,
137 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
143 if (DriverConfiguration
== NULL
) {
144 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
145 Status
= gBS
->InstallMultipleProtocolInterfaces (
146 &DriverBindingHandle
,
147 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
148 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
152 Status
= gBS
->InstallMultipleProtocolInterfaces (
153 &DriverBindingHandle
,
154 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
155 &gEfiComponentNameProtocolGuid
, ComponentName
,
156 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
161 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
162 Status
= gBS
->InstallMultipleProtocolInterfaces (
163 &DriverBindingHandle
,
164 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
165 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
166 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
170 Status
= gBS
->InstallMultipleProtocolInterfaces (
171 &DriverBindingHandle
,
172 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
173 &gEfiComponentNameProtocolGuid
, ComponentName
,
174 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
175 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
183 // ASSERT if the call to InstallMultipleProtocolInterfaces() failed
185 ASSERT_EFI_ERROR (Status
);
188 // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol
190 DriverBinding
->ImageHandle
= ImageHandle
;
191 DriverBinding
->DriverBindingHandle
= DriverBindingHandle
;
199 Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,
200 Component Name 2 onto the driver's DriverBindingHandle. This is typically the same as the driver's
201 ImageHandle, but it can be different if the driver produces multiple DriverBinding Protocols.
202 If the Drvier Binding Protocol interface is NULL, then ASSERT ().
203 If the installation fails, then ASSERT ().
205 @param ImageHandle The image handle of the driver.
206 @param SystemTable The EFI System Table that was passed to the driver's entry point.
207 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
208 @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
209 parameter is NULL, then a new handle is created.
210 @param ComponentName A Component Name Protocol instance that this driver is producing.
211 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
213 @retval EFI_SUCCESS The protocol installation is completed successfully.
214 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
219 EfiLibInstallDriverBindingComponentName2 (
220 IN CONST EFI_HANDLE ImageHandle
,
221 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
222 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
223 IN EFI_HANDLE DriverBindingHandle
,
224 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
225 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2 OPTIONAL
230 ASSERT (NULL
!= DriverBinding
);
232 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
233 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
234 Status
= gBS
->InstallMultipleProtocolInterfaces (
235 &DriverBindingHandle
,
236 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
240 Status
= gBS
->InstallMultipleProtocolInterfaces (
241 &DriverBindingHandle
,
242 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
243 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
248 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
249 Status
= gBS
->InstallMultipleProtocolInterfaces (
250 &DriverBindingHandle
,
251 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
252 &gEfiComponentNameProtocolGuid
, ComponentName
,
256 Status
= gBS
->InstallMultipleProtocolInterfaces (
257 &DriverBindingHandle
,
258 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
259 &gEfiComponentNameProtocolGuid
, ComponentName
,
260 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
266 // ASSERT if the call to InstallMultipleProtocolInterfaces() failed
268 ASSERT_EFI_ERROR (Status
);
271 // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol
273 DriverBinding
->ImageHandle
= ImageHandle
;
274 DriverBinding
->DriverBindingHandle
= DriverBindingHandle
;
282 Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,
283 Component Name 2, Driver Configure, Driver Diagnostic and Driver Diagnostic 2 Protocols onto the driver's
284 DriverBindingHandle. This is typically the same as the driver's ImageHandle, but it can be different if
285 the driver produces multiple DriverBinding Protocols.
286 If the Drvier Binding Protocol interface is NULL, then ASSERT ().
287 If the installation fails, then ASSERT ().
289 @param ImageHandle The image handle of the driver.
290 @param SystemTable The EFI System Table that was passed to the driver's entry point.
291 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
292 @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
293 parameter is NULL, then a new handle is created.
294 @param ComponentName A Component Name Protocol instance that this driver is producing.
295 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
296 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
297 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
298 @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing.
300 @retval EFI_SUCCESS The protocol installation is completed successfully.
301 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
306 EfiLibInstallAllDriverProtocols2 (
307 IN CONST EFI_HANDLE ImageHandle
,
308 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
309 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
310 IN EFI_HANDLE DriverBindingHandle
,
311 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
312 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2
, OPTIONAL
313 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
314 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics
, OPTIONAL
315 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL
*DriverDiagnostics2 OPTIONAL
320 ASSERT (NULL
!= DriverBinding
);
322 if (DriverConfiguration
== NULL
) {
323 if (DriverDiagnostics
== NULL
|| FeaturePcdGet(PcdDriverDiagnosticsDisable
)) {
324 if (DriverDiagnostics2
== NULL
|| FeaturePcdGet(PcdDriverDiagnostics2Disable
)) {
325 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
326 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
327 Status
= gBS
->InstallMultipleProtocolInterfaces (
328 &DriverBindingHandle
,
329 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
333 Status
= gBS
->InstallMultipleProtocolInterfaces (
334 &DriverBindingHandle
,
335 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
336 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
341 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
342 Status
= gBS
->InstallMultipleProtocolInterfaces (
343 &DriverBindingHandle
,
344 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
345 &gEfiComponentNameProtocolGuid
, ComponentName
,
349 Status
= gBS
->InstallMultipleProtocolInterfaces (
350 &DriverBindingHandle
,
351 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
352 &gEfiComponentNameProtocolGuid
, ComponentName
,
353 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
359 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
360 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
361 Status
= gBS
->InstallMultipleProtocolInterfaces (
362 &DriverBindingHandle
,
363 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
364 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
368 Status
= gBS
->InstallMultipleProtocolInterfaces (
369 &DriverBindingHandle
,
370 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
371 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
372 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
377 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
378 Status
= gBS
->InstallMultipleProtocolInterfaces (
379 &DriverBindingHandle
,
380 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
381 &gEfiComponentNameProtocolGuid
, ComponentName
,
382 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
386 Status
= gBS
->InstallMultipleProtocolInterfaces (
387 &DriverBindingHandle
,
388 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
389 &gEfiComponentNameProtocolGuid
, ComponentName
,
390 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
391 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
398 if (DriverDiagnostics2
== NULL
|| FeaturePcdGet(PcdDriverDiagnostics2Disable
)) {
399 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
400 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
401 Status
= gBS
->InstallMultipleProtocolInterfaces (
402 &DriverBindingHandle
,
403 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
404 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
408 Status
= gBS
->InstallMultipleProtocolInterfaces (
409 &DriverBindingHandle
,
410 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
411 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
412 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
417 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
418 Status
= gBS
->InstallMultipleProtocolInterfaces (
419 &DriverBindingHandle
,
420 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
421 &gEfiComponentNameProtocolGuid
, ComponentName
,
422 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
426 Status
= gBS
->InstallMultipleProtocolInterfaces (
427 &DriverBindingHandle
,
428 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
429 &gEfiComponentNameProtocolGuid
, ComponentName
,
430 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
431 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
437 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
438 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
439 Status
= gBS
->InstallMultipleProtocolInterfaces (
440 &DriverBindingHandle
,
441 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
442 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
443 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
447 Status
= gBS
->InstallMultipleProtocolInterfaces (
448 &DriverBindingHandle
,
449 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
450 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
451 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
452 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
457 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
458 Status
= gBS
->InstallMultipleProtocolInterfaces (
459 &DriverBindingHandle
,
460 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
461 &gEfiComponentNameProtocolGuid
, ComponentName
,
462 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
463 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
467 Status
= gBS
->InstallMultipleProtocolInterfaces (
468 &DriverBindingHandle
,
469 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
470 &gEfiComponentNameProtocolGuid
, ComponentName
,
471 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
472 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
473 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
481 if (DriverDiagnostics
== NULL
|| FeaturePcdGet(PcdDriverDiagnosticsDisable
)) {
482 if (DriverDiagnostics2
== NULL
|| FeaturePcdGet(PcdDriverDiagnostics2Disable
)) {
483 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
484 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
485 Status
= gBS
->InstallMultipleProtocolInterfaces (
486 &DriverBindingHandle
,
487 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
488 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
492 Status
= gBS
->InstallMultipleProtocolInterfaces (
493 &DriverBindingHandle
,
494 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
495 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
496 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
501 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
502 Status
= gBS
->InstallMultipleProtocolInterfaces (
503 &DriverBindingHandle
,
504 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
505 &gEfiComponentNameProtocolGuid
, ComponentName
,
506 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
510 Status
= gBS
->InstallMultipleProtocolInterfaces (
511 &DriverBindingHandle
,
512 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
513 &gEfiComponentNameProtocolGuid
, ComponentName
,
514 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
515 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
521 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
522 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
523 Status
= gBS
->InstallMultipleProtocolInterfaces (
524 &DriverBindingHandle
,
525 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
526 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
527 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
531 Status
= gBS
->InstallMultipleProtocolInterfaces (
532 &DriverBindingHandle
,
533 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
534 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
535 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
536 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
541 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
542 Status
= gBS
->InstallMultipleProtocolInterfaces (
543 &DriverBindingHandle
,
544 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
545 &gEfiComponentNameProtocolGuid
, ComponentName
,
546 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
547 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
551 Status
= gBS
->InstallMultipleProtocolInterfaces (
552 &DriverBindingHandle
,
553 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
554 &gEfiComponentNameProtocolGuid
, ComponentName
,
555 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
556 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
557 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
564 if (DriverDiagnostics2
== NULL
|| FeaturePcdGet(PcdDriverDiagnostics2Disable
)) {
565 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
566 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
567 Status
= gBS
->InstallMultipleProtocolInterfaces (
568 &DriverBindingHandle
,
569 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
570 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
571 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
575 Status
= gBS
->InstallMultipleProtocolInterfaces (
576 &DriverBindingHandle
,
577 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
578 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
579 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
580 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
585 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
586 Status
= gBS
->InstallMultipleProtocolInterfaces (
587 &DriverBindingHandle
,
588 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
589 &gEfiComponentNameProtocolGuid
, ComponentName
,
590 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
591 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
595 Status
= gBS
->InstallMultipleProtocolInterfaces (
596 &DriverBindingHandle
,
597 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
598 &gEfiComponentNameProtocolGuid
, ComponentName
,
599 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
600 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
601 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
607 if (ComponentName
== NULL
|| FeaturePcdGet(PcdComponentNameDisable
)) {
608 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
609 Status
= gBS
->InstallMultipleProtocolInterfaces (
610 &DriverBindingHandle
,
611 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
612 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
613 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
614 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
618 Status
= gBS
->InstallMultipleProtocolInterfaces (
619 &DriverBindingHandle
,
620 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
621 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
622 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
623 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
624 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
629 if (ComponentName2
== NULL
|| FeaturePcdGet(PcdComponentName2Disable
)) {
630 Status
= gBS
->InstallMultipleProtocolInterfaces (
631 &DriverBindingHandle
,
632 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
633 &gEfiComponentNameProtocolGuid
, ComponentName
,
634 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
635 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
636 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
640 Status
= gBS
->InstallMultipleProtocolInterfaces (
641 &DriverBindingHandle
,
642 &gEfiDriverBindingProtocolGuid
, DriverBinding
,
643 &gEfiComponentNameProtocolGuid
, ComponentName
,
644 &gEfiComponentName2ProtocolGuid
, ComponentName2
,
645 &gEfiDriverConfigurationProtocolGuid
, DriverConfiguration
,
646 &gEfiDriverDiagnosticsProtocolGuid
, DriverDiagnostics
,
647 &gEfiDriverDiagnostics2ProtocolGuid
, DriverDiagnostics2
,
657 // ASSERT if the call to InstallMultipleProtocolInterfaces() failed
659 ASSERT_EFI_ERROR (Status
);
662 // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol
664 DriverBinding
->ImageHandle
= ImageHandle
;
665 DriverBinding
->DriverBindingHandle
= DriverBindingHandle
;