Uninstallprotocolinterface() – Intel Extensible Firmware Interface User Manual
Page 136

Extensible Firmware Interface Specification
5-38
12/01/02
Version 1.10
UninstallProtocolInterface()
Summary
Removes a protocol interface from a device handle.
Prototype
typedef
EFI_STATUS
UninstallProtocolInterface (
IN EFI_HANDLE
Handle,
IN EFI_GUID
*Protocol,
IN VOID
*Interface
);
Parameters
Handle
The handle on which the interface was installed. If
Handle
is not a
valid handle, then
EFI_INVALID_PARAMETER
is returned. Type
EFI_HANDLE
is defined in the
function description.
Protocol
The numeric ID of the interface. It is the caller’s responsibility to pass in
a valid GUID. See “Wired For Management Baseline” for a description
of valid GUID values. Type
EFI_GUID
is defined in the
InstallProtocolInterface()
function description.
Interface
A pointer to the interface.
NULL
can be used if a structure is not
associated with
Protocol
.
Description
The
UninstallProtocolInterface()
function removes a protocol interface from the
handle on which it was previously installed. The
Protocol
and
Interface
values define the
protocol interface to remove from the handle.
The caller is responsible for ensuring that there are no references to a protocol interface that has
been removed. In some cases, outstanding reference information is not available in the protocol, so
the protocol, once added, cannot be removed. Examples include Console I/O, Block I/O, Disk I/O,
and (in general) handles to device protocols.
If the last protocol interface is removed from a handle, the handle is freed and is no longer valid.
EFI 1.10 Extension
The extension to this service directly addresses the limitations described in the section above.
There may be some drivers that are currently consuming the protocol interface that needs to be
uninstalled, so it may be dangerous to just blindly remove a protocol interface from the system.
Since the usage of protocol interfaces is now being tracked for components that use the
and
boot services, a safe version of this function can be
implemented. Before the protocol interface is removed, an attempt is made to force all the drivers
that are consuming the protocol interface to stop consuming that protocol interface. This is done by
looping through all the drivers that currently have the protocol interface open with an attribute of
EFI_OPEN_PROTOCOL_BY_DRIVER
or
EFI_OPEN_PROTOCOL_BY_DRIVER |