TianoCore EDK2 master
Loading...
Searching...
No Matches
UefiDevicePathLibOptionalDevicePathProtocol.c
Go to the documentation of this file.
1
16#include "UefiDevicePathLib.h"
17
21
37EFIAPI
39 IN EFI_HANDLE ImageHandle,
40 IN EFI_SYSTEM_TABLE *SystemTable
41 )
42{
43 EFI_STATUS Status;
44
45 Status = gBS->LocateProtocol (
46 &gEfiDevicePathUtilitiesProtocolGuid,
47 NULL,
48 (VOID **)&mDevicePathLibDevicePathUtilities
49 );
50 ASSERT_EFI_ERROR (Status);
51 ASSERT (mDevicePathLibDevicePathUtilities != NULL);
52 return Status;
53}
54
69EFIAPI
72 )
73{
74 if (mDevicePathLibDevicePathUtilities != NULL) {
75 return mDevicePathLibDevicePathUtilities->GetDevicePathSize (DevicePath);
76 } else {
77 return UefiDevicePathLibGetDevicePathSize (DevicePath);
78 }
79}
80
98EFIAPI
101 )
102{
103 if (mDevicePathLibDevicePathUtilities != NULL) {
104 return mDevicePathLibDevicePathUtilities->DuplicateDevicePath (DevicePath);
105 } else {
106 return UefiDevicePathLibDuplicateDevicePath (DevicePath);
107 }
108}
109
135EFIAPI
137 IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath OPTIONAL,
138 IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath OPTIONAL
139 )
140{
141 if (mDevicePathLibDevicePathUtilities != NULL) {
142 return mDevicePathLibDevicePathUtilities->AppendDevicePath (FirstDevicePath, SecondDevicePath);
143 } else {
144 return UefiDevicePathLibAppendDevicePath (FirstDevicePath, SecondDevicePath);
145 }
146}
147
177EFIAPI
179 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL,
180 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL
181 )
182{
183 if (mDevicePathLibDevicePathUtilities != NULL) {
184 return mDevicePathLibDevicePathUtilities->AppendDeviceNode (DevicePath, DevicePathNode);
185 } else {
186 return UefiDevicePathLibAppendDevicePathNode (DevicePath, DevicePathNode);
187 }
188}
189
214EFIAPI
216 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL,
217 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance OPTIONAL
218 )
219{
220 if (mDevicePathLibDevicePathUtilities != NULL) {
221 return mDevicePathLibDevicePathUtilities->AppendDevicePathInstance (DevicePath, DevicePathInstance);
222 } else {
223 return UefiDevicePathLibAppendDevicePathInstance (DevicePath, DevicePathInstance);
224 }
225}
226
256EFIAPI
258 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
259 OUT UINTN *Size
260 )
261{
262 if (mDevicePathLibDevicePathUtilities != NULL) {
263 return mDevicePathLibDevicePathUtilities->GetNextDevicePathInstance (DevicePath, Size);
264 } else {
265 return UefiDevicePathLibGetNextDevicePathInstance (DevicePath, Size);
266 }
267}
268
289EFIAPI
291 IN UINT8 NodeType,
292 IN UINT8 NodeSubType,
293 IN UINT16 NodeLength
294 )
295{
296 if (mDevicePathLibDevicePathUtilities != NULL) {
297 return mDevicePathLibDevicePathUtilities->CreateDeviceNode (NodeType, NodeSubType, NodeLength);
298 } else {
299 return UefiDevicePathLibCreateDeviceNode (NodeType, NodeSubType, NodeLength);
300 }
301}
302
318BOOLEAN
319EFIAPI
322 )
323{
324 if (mDevicePathLibDevicePathUtilities != NULL) {
325 return mDevicePathLibDevicePathUtilities->IsDevicePathMultiInstance (DevicePath);
326 } else {
328 }
329}
330
338VOID *
340 EFI_GUID *ProtocolGuid
341 )
342{
343 EFI_STATUS Status;
344 VOID *Protocol;
345
346 Status = gBS->LocateProtocol (
347 ProtocolGuid,
348 NULL,
349 (VOID **)&Protocol
350 );
351 if (EFI_ERROR (Status)) {
352 return NULL;
353 } else {
354 return Protocol;
355 }
356}
357
373CHAR16 *
374EFIAPI
377 IN BOOLEAN DisplayOnly,
378 IN BOOLEAN AllowShortcuts
379 )
380{
381 if (mDevicePathLibDevicePathToText == NULL) {
382 mDevicePathLibDevicePathToText = UefiDevicePathLibLocateProtocol (&gEfiDevicePathToTextProtocolGuid);
383 }
384
385 if (mDevicePathLibDevicePathToText != NULL) {
386 return mDevicePathLibDevicePathToText->ConvertDeviceNodeToText (DeviceNode, DisplayOnly, AllowShortcuts);
387 }
388
389 return UefiDevicePathLibConvertDeviceNodeToText (DeviceNode, DisplayOnly, AllowShortcuts);
390}
391
407CHAR16 *
408EFIAPI
411 IN BOOLEAN DisplayOnly,
412 IN BOOLEAN AllowShortcuts
413 )
414{
415 if (mDevicePathLibDevicePathToText == NULL) {
416 mDevicePathLibDevicePathToText = UefiDevicePathLibLocateProtocol (&gEfiDevicePathToTextProtocolGuid);
417 }
418
419 if (mDevicePathLibDevicePathToText != NULL) {
420 return mDevicePathLibDevicePathToText->ConvertDevicePathToText (DevicePath, DisplayOnly, AllowShortcuts);
421 }
422
423 return UefiDevicePathLibConvertDevicePathToText (DevicePath, DisplayOnly, AllowShortcuts);
424}
425
438EFIAPI
440 IN CONST CHAR16 *TextDeviceNode
441 )
442{
443 if (mDevicePathLibDevicePathFromText == NULL) {
444 mDevicePathLibDevicePathFromText = UefiDevicePathLibLocateProtocol (&gEfiDevicePathFromTextProtocolGuid);
445 }
446
447 if (mDevicePathLibDevicePathFromText != NULL) {
448 return mDevicePathLibDevicePathFromText->ConvertTextToDeviceNode (TextDeviceNode);
449 }
450
451 return UefiDevicePathLibConvertTextToDeviceNode (TextDeviceNode);
452}
453
467EFIAPI
469 IN CONST CHAR16 *TextDevicePath
470 )
471{
472 if (mDevicePathLibDevicePathFromText == NULL) {
473 mDevicePathLibDevicePathFromText = UefiDevicePathLibLocateProtocol (&gEfiDevicePathFromTextProtocolGuid);
474 }
475
476 if (mDevicePathLibDevicePathFromText != NULL) {
477 return mDevicePathLibDevicePathFromText->ConvertTextToDevicePath (TextDevicePath);
478 }
479
480 return UefiDevicePathLibConvertTextToDevicePath (TextDevicePath);
481}
UINT64 UINTN
EFI_DEVICE_PATH_PROTOCOL *EFIAPI UefiDevicePathLibConvertTextToDeviceNode(IN CONST CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI UefiDevicePathLibConvertTextToDevicePath(IN CONST CHAR16 *TextDevicePath)
CHAR16 *EFIAPI UefiDevicePathLibConvertDeviceNodeToText(IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts)
CHAR16 *EFIAPI UefiDevicePathLibConvertDevicePathToText(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI UefiDevicePathLibAppendDevicePath(IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath OPTIONAL)
UINTN EFIAPI UefiDevicePathLibGetDevicePathSize(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI UefiDevicePathLibAppendDevicePathNode(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI UefiDevicePathLibAppendDevicePathInstance(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance OPTIONAL)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI UefiDevicePathLibDuplicateDevicePath(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
BOOLEAN EFIAPI UefiDevicePathLibIsDevicePathMultiInstance(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI UefiDevicePathLibGetNextDevicePathInstance(IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT UINTN *Size)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI UefiDevicePathLibCreateDeviceNode(IN UINT8 NodeType, IN UINT8 NodeSubType, IN UINT16 NodeLength)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define GLOBAL_REMOVE_IF_UNREFERENCED
Definition: Base.h:48
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
EFI_BOOT_SERVICES * gBS
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePathNode(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL)
CHAR16 *EFIAPI ConvertDeviceNodeToText(IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePathInstance(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance OPTIONAL)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI CreateDeviceNode(IN UINT8 NodeType, IN UINT8 NodeSubType, IN UINT16 NodeLength)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePath(IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath OPTIONAL)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI GetNextDevicePathInstance(IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT UINTN *Size)
CHAR16 *EFIAPI ConvertDevicePathToText(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts)
VOID * UefiDevicePathLibLocateProtocol(EFI_GUID *ProtocolGuid)
UINTN EFIAPI GetDevicePathSize(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI DuplicateDevicePath(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI ConvertTextToDevicePath(IN CONST CHAR16 *TextDevicePath)
BOOLEAN EFIAPI IsDevicePathMultiInstance(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_STATUS EFIAPI UefiDevicePathLibOptionalDevicePathProtocolConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI ConvertTextToDeviceNode(IN CONST CHAR16 *TextDeviceNode)
Definition: Base.h:213