17.3 Bus Specific Driver Override Protocol Installation
The example below shows a fragment from the Driver Binding Protocol Start() that installs the Bus Specific Driver Override Protocol instance onto a child handle produced by the bus driver.

Example 165-Install Bus Specific Driver Override Protocol

1
#include <Uefi.h>
2
#include <Protocol/DriverBinding.h>
3
#include <Protocol/BusSpecificDriverOverride.h>
4
#include <Library/UefiBootServicesTableLib.h>
5
6
EFI_STATUS EFIAPI
7
AbcStart (
8
IN EFI_DRIVER_BINDING_PROTOCOL *This,
9
IN EFI_HANDLE ControllerHandle,
10
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
11
)
12
{
13
EFI_STATUS Status;
14
ABC_PRIVATE_DATA *Private;
15
EFI_HANDLE ChildHandle;
16
17
. .
18
19
Status = gBS->InstallMultipleProtocolInterfaces (
20
ChildHandle,
21
&gEfiBusSpecificDriverOverrideProtocolGuid,
22
&Private->BusSpecificDriverOverride,
23
NULL
24
);
25
. .
26
}
Copied!
The following example shows a fragment from the Driver Binding Protocol Stop() function that uninstalls the Bus Specific Driver Override Protocol instance from a child handle produced by the bus driver.

Example 166-Uninstall Bus Specific Driver Override Protocol

1
#include <Uefi.h>
2
#include <Protocol/DriverBinding.h>
3
#include <Protocol/BusSpecificDriverOverride.h>
4
#include <Library/UefiBootServicesTableLib.h>
5
6
EFI_STATUS
7
EFIAPI
8
AbcStop (
9
IN EFI_DRIVER_BINDING_PROTOCOL *This,
10
IN EFI_HANDLE ControllerHandle,
11
IN UINTN NumberOfChildren,
12
IN EFI_HANDLE *ChildHandleBuffer
13
)
14
{
15
EFI_STATUS Status;
16
ABC_PRIVATE_DATA *Private;
17
EFI_HANDLE ChildHandle;
18
19
. .
20
21
Status = gBS->UninstallMultipleProtocolInterfaces (
22
ChildHandle,
23
&gEfiBusSpecificDriverOverrideProtocolGuid,
24
&Private->BusSpecificDriverOverride,
25
NULL
26
);
27
. .
28
}
Copied!