]>
Commit | Line | Data |
---|---|---|
7e284acb | 1 | /** @file\r |
2 | Null Platform Hook Library instance.\r | |
3 | \r | |
4 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #include <Base.h>\r | |
16 | \r | |
17 | #include <Protocol/EmuThunk.h>\r | |
18 | #include <Protocol/EmuGraphicsWindow.h>\r | |
19 | #include <Protocol/EmuBlockIo.h>\r | |
20 | #include <Protocol/SimpleFileSystem.h>\r | |
21 | #include <Protocol/EmuThread.h>\r | |
22 | \r | |
23 | #include <Library/DevicePathTextLib.h>\r | |
24 | #include <Library/BaseMemoryLib.h>\r | |
25 | \r | |
26 | \r | |
27 | /**\r | |
28 | Converts a Vendor device path structure to its string representative.\r | |
29 | \r | |
30 | @param Str The string representative of input device.\r | |
31 | @param DevPath The input device path structure.\r | |
32 | @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r | |
33 | of the display node is used, where applicable. If DisplayOnly\r | |
34 | is FALSE, then the longer text representation of the display node\r | |
35 | is used.\r | |
36 | @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text\r | |
37 | representation for a device node can be used, where applicable.\r | |
38 | \r | |
39 | @return EFI_NOT_FOUND if no string representation exists.\r | |
40 | @return EFI_SUCCESS a string representation was created.\r | |
41 | **/\r | |
42 | EFI_STATUS\r | |
43 | EFIAPI\r | |
44 | DevPathToTextVendorLib (\r | |
45 | IN OUT POOL_PRINT *Str,\r | |
46 | IN VOID *DevPath,\r | |
47 | IN BOOLEAN DisplayOnly,\r | |
48 | IN BOOLEAN AllowShortcuts\r | |
49 | )\r | |
50 | {\r | |
51 | EMU_VENDOR_DEVICE_PATH_NODE *Vendor;\r | |
52 | CHAR16 *Type;\r | |
53 | \r | |
54 | Vendor = (EMU_VENDOR_DEVICE_PATH_NODE *)DevPath;\r | |
55 | if (CompareGuid (&Vendor->VendorDevicePath.Guid, &gEmuThunkProtocolGuid)) {\r | |
56 | CatPrint (Str, L"EmuThunk()");\r | |
57 | return EFI_SUCCESS;\r | |
58 | }\r | |
59 | if (CompareGuid (&Vendor->VendorDevicePath.Guid, &gEmuGraphicsWindowProtocolGuid)) {\r | |
60 | CatPrint (Str, L"EmuGraphics(%d)", Vendor->Instance);\r | |
61 | return EFI_SUCCESS;\r | |
62 | }\r | |
63 | if (CompareGuid (&Vendor->VendorDevicePath.Guid, &gEfiSimpleFileSystemProtocolGuid)) {\r | |
64 | CatPrint (Str, L"EmuFs(%d)", Vendor->Instance);\r | |
65 | return EFI_SUCCESS;\r | |
66 | }\r | |
67 | if (CompareGuid (&Vendor->VendorDevicePath.Guid, &gEmuBlockIoProtocolGuid)) {\r | |
68 | CatPrint (Str, L"EmuBlk(%d)", Vendor->Instance);\r | |
69 | return EFI_SUCCESS;\r | |
70 | }\r | |
71 | if (CompareGuid (&Vendor->VendorDevicePath.Guid, &gEmuThreadThunkProtocolGuid)) {\r | |
72 | CatPrint (Str, L"EmuThread()");\r | |
73 | return EFI_SUCCESS;\r | |
74 | }\r | |
75 | \r | |
76 | return EFI_NOT_FOUND;\r | |
77 | }\r | |
78 | \r |