OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
ProtocolSupport.c File Reference
#include <Uefi.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/ShellParameters.h>

Go to the source code of this file.

Functions

EFI_STATUS GetArguments (OUT UINTN *Argc, OUT CHAR16 ***Argv)
 
EFI_STATUS OcUninstallAllProtocolInstances (EFI_GUID *Protocol)
 
EFI_STATUS OcHandleProtocolFallback (IN EFI_HANDLE Handle, IN EFI_GUID *Protocol, OUT VOID **Interface)
 
UINTN OcCountProtocolInstances (IN EFI_GUID *Protocol)
 
VOID * OcGetProtocol (IN EFI_GUID *Protocol, IN UINTN ErrorLevel, IN CONST CHAR8 *CallerName OPTIONAL, IN CONST CHAR8 *ProtocolName OPTIONAL)
 

Detailed Description

Copyright (C) 2019, vit9696. All rights reserved.

All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file ProtocolSupport.c.

Function Documentation

◆ GetArguments()

EFI_STATUS GetArguments ( OUT UINTN * Argc,
OUT CHAR16 *** Argv )

Obtain application arguments.

Parameters
[out]ArgcArgument count.
[out]ArgvArgument list.
Return values
EFI_SUCCESSon success.

Definition at line 25 of file ProtocolSupport.c.

◆ OcCountProtocolInstances()

UINTN OcCountProtocolInstances ( IN EFI_GUID * Protocol)

Count instances found under a specific protocol.

Parameters
[in]ProtocolProtocol to search for.
Returns
Number of instances found.

Definition at line 149 of file ProtocolSupport.c.

◆ OcGetProtocol()

VOID * OcGetProtocol ( IN EFI_GUID * Protocol,
IN UINTN ErrorLevel,
IN CONST CHAR8 *CallerName OPTIONAL,
IN CONST CHAR8 *ProtocolName OPTIONAL )

Obtain protocol. If not obtained returns NULL, and optionally adds log message "[CallerName] cannot get protocol [ProtocolName] - %r".

Parameters
[in]ProtocolProtocol to search for.
[in]ErrorLevelThe error level of the debug log message to print if protocol not found. Send zero to generate no log message (caller becomes reponsible).
[in]CallerNameThe caller name for the error message; should always be provided if ErrorLevel is non-zero; will work, but with less useful log output, if ommitted in that case.
[in]ProtocolNameThe protocol name for the error message; optional, protocol GUID will be used as protocol name in error message when required, otherwise.
Returns
Protocol instance, or NULL if not found.

Definition at line 179 of file ProtocolSupport.c.

◆ OcHandleProtocolFallback()

EFI_STATUS OcHandleProtocolFallback ( IN EFI_HANDLE Handle,
IN EFI_GUID * Protocol,
OUT VOID ** Interface )

Handle protocol on handle and fallback to any protocol when missing.

Parameters
[in]HandleHandle to search for protocol.
[in]ProtocolProtocol to search for.
[out]InterfaceProtocol interface if found.
Return values
EFI_SUCCESSon success.

Definition at line 124 of file ProtocolSupport.c.

◆ OcUninstallAllProtocolInstances()

EFI_STATUS OcUninstallAllProtocolInstances ( EFI_GUID * Protocol)

Uninstall all protocols with the specified GUID.

Parameters
[in]ProtocolThe published unique identifier of the protocol. It is the caller's responsibility to pass in a valid GUID.
Return values
EFI_SUCCESSon success.

Definition at line 70 of file ProtocolSupport.c.