Intel Extensible Firmware Interface User Manual
Page 153

Services — Boot Services
Version 1.10
12/01/02
5-55
NULL,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
);
//
// EFI_OPEN_PROTOCOL_BY_DRIVER example
//
Opens the XYZ I/O Protocol on ControllerHandle
//
The driver that is opening the protocol is identified by the
//
Driver Binding Protocol instance This.
This->DriverBindingHandle
//
identifies the agent that is opening the protocol interface, and it
//
is opening this protocol on behalf of ControllerHandle.
//
Possible return status codes:
//
EFI_SUCCESS
: The protocol was opened and returned in XyzIo
//
EFI_UNSUPPORTED
: The protocol is not present on ControllerHandle
//
EFI_ALREADY_STARTED : The protocol is already opened by the driver
//
EFI_ACCESS_DENIED
: The protocol is managed by a different driver
//
Status = gBS->OpenProtocol (
ControllerHandle,
&gEfiXyzIoProtocol,
&XyzIo,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
//
// EFI_OPEN_PROTOCOL_BY_DRIVER | EFI_OPEN_PROTOCOL_EXCLUSIVE example
//
Opens the XYZ I/O Protocol on ControllerHandle
//
The driver that is opening the protocol is identified by the
//
Driver Binding Protocol instance This.
This->DriverBindingHandle
//
identifies the agent that is opening the protocol interface, and it
//
is opening this protocol on behalf of ControllerHandle.
//
Possible return status codes:
//
EFI_SUCCESS
: The protocol was opened and returned in XyzIo.
If
//
a different driver had the XYZ I/O Protocol opened
//
BY_DRIVER, then that driver was disconnected to
//
allow this driver to open the XYZ I/O Protocol.
//
EFI_UNSUPPORTED
: The protocol is not present on ControllerHandle
//
EFI_ALREADY_STARTED : The protocol is already opened by the driver
//
EFI_ACCESS_DENIED
: The protocol is managed by a different driver that
//
already has the protocol opened with an EXCLUSIVE
//
attribute.
//
Status = gBS->OpenProtocol (
ControllerHandle,
&gEfiXyzIoProtocol,
&XyzIo,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER | EFI_OPEN_PROTOCOL_EXCLUSIVE
);