EFI DEVICE PATH TO TEXT PROTOCOL

From PhoenixWiki

Jump to: navigation, search

Convert device nodes and paths to text

Contents

GUID

#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
  {0x8b843e20,0x8132,0x4852,0x90,0xcc,0x55,0x1a,0x4e,0x4a,0x7f, 0x1c}

Protocol Interface Structure

#include EFI_PROTOCOL_CONSUMER(DevicePathToText)

extern EFI_GUID gEfiDevicePathToTextProtocolGuid;
typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL {
  EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText;
  EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText;
} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;

Members

Member Description
ConvertDeviceNodeToText Converts a device node to text.
ConvertDevicePathToText Converts a device path to text.

Description

The EFI_DEVICE_PATH_TO_TEXT_PROTOCOL provides common utility functions for converting device nodes and device paths to a text representation.

ConvertDeviceNodeToText()

Convert a device node to its text representation.

Prototype

typedef
CHAR16*
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) (
  IN CONST EFI_DEVICE_PATH_PROTOCOL* DeviceNode,
  IN BOOLEAN                         DisplayOnly,
  IN BOOLEAN                         AllowShortcuts
  );

Parameters

Parameter Description
DeviceNode Points to the device node to be converted.
DisplayOnly If DisplayOnly is TRUE, then the shorter text representation of the display node is used, where applicable. If DisplayOnly is FALSE, then the longer text representation of the display node is used.
AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text representation for a device node can be used, where applicable.

Description
The ConvertDeviceNodeToText function converts a device node to its text representation and copies it into a newly allocated buffer.

The DisplayOnly parameter controls whether the longer (parseable) or shorter (display-only) form of the conversion is used.

The AllowShortcuts is FALSE, then the shortcut forms of text representation for a device node cannot be used. A shortcut form is one which uses information other than the type or subtype.

The memory is allocated from EFI boot services memory. It is the responsibility of the caller to free the memory allocated.

Returns
This function returns the pointer to the allocated text representation of the device node data or else NULL if DeviceNode was NULL or there was insufficient memory.

ConvertDevicePathToText()

Convert a device path to its text representation.

Prototype

typedef
CHAR16*
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) (
  IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePath,
  IN BOOLEAN                         DisplayOnly,
  IN BOOLEAN                         AllowShortcuts
  );

Parameters

Parameter Description
DeviceNode Points to the device path to be converted.
DisplayOnly If DisplayOnly is TRUE, then the shorter text representation of the display node is used, where applicable. If DisplayOnly is FALSE, then the longer text representation of the display node is used.
AllowShortcuts The AllowShortcuts is FALSE, then the shortcut forms of text representation for a device node cannot be used.


Description
This function converts a device path into its text representation and copies it into an allocated buffer.

The DisplayOnly parameter controls whether the longer (parseable) or shorter (display-only) form of the conversion is used.

The AllowShortcuts is FALSE, then the shortcut forms of text representation for a device node cannot be used. A shortcut form is one which uses information other than the type or subtype.

The memory is allocated from EFI boot services memory. It is the responsibility of the caller to free the memory allocated.

Returned<r> This function returns a pointer to the allocated text representation of the device node or NULL if DevicePath was NULL or there was insufficient memory.


Copyright (C) 2009 Phoenix Technologies Ltd. All Rights Reserved. Portions copyright (C) 2008 UEFI Forum, Inc. Used with permission

Personal tools