]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/DevicePathLib.h
Added CONST for some sting type to follow MWG-0.51. Tracker 26 and 28
[mirror_edk2.git] / MdePkg / Include / Library / DevicePathLib.h
CommitLineData
878ddf1f 1/** @file\r
2 Entry point to a DXE Boot Services Driver\r
3\r
4 Copyright (c) 2006, Intel Corporation \r
5 All rights reserved. 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 Module Name: DevicePathLib.h\r
14\r
15**/\r
16\r
17#ifndef __DEVICE_PATH_LIB_H__\r
18#define __DEVICE_PATH_LIB_H__\r
19\r
20/**\r
21 This function returns the size, in bytes, \r
22 of the device path data structure specified by DevicePath.\r
23 If DevicePath is NULL, then 0 is returned.\r
24\r
25 @param DevicePath A pointer to a device path data structure.\r
26\r
27 @return The size of a device path in bytes.\r
28\r
29**/\r
30UINTN\r
31EFIAPI\r
32GetDevicePathSize (\r
33 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
34 )\r
35;\r
36\r
37/**\r
38 This function allocates space for a new copy of the device path\r
39 specified by DevicePath.\r
40\r
41 @param DevicePath A pointer to a device path data structure.\r
42\r
43 @return The duplicated device path.\r
44\r
45**/\r
46EFI_DEVICE_PATH_PROTOCOL *\r
47EFIAPI\r
48DuplicateDevicePath (\r
49 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
50 )\r
51;\r
52\r
53/**\r
54 This function appends the device path SecondDevicePath\r
55 to every device path instance in FirstDevicePath. \r
56\r
57 @param FirstDevicePath A pointer to a device path data structure.\r
58 \r
59 @param SecondDevicePath A pointer to a device path data structure.\r
60\r
61 @return\r
62 A pointer to the new device path is returned.\r
63 NULL is returned if space for the new device path could not be allocated from pool.\r
64 It is up to the caller to free the memory used by FirstDevicePath and SecondDevicePath\r
65 if they are no longer needed.\r
66\r
67**/\r
68EFI_DEVICE_PATH_PROTOCOL *\r
69EFIAPI\r
70AppendDevicePath (\r
71 IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,\r
72 IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath\r
73 )\r
74;\r
75\r
76/**\r
77 This function appends the device path node SecondDevicePath\r
78 to every device path instance in FirstDevicePath.\r
79\r
80 @param FirstDevicePath A pointer to a device path data structure.\r
81 \r
82 @param SecondDevicePath A pointer to a single device path node.\r
83\r
84 @return\r
85 A pointer to the new device path.\r
86 If there is not enough temporary pool memory available to complete this function,\r
87 then NULL is returned.\r
88\r
89**/\r
90EFI_DEVICE_PATH_PROTOCOL *\r
91EFIAPI\r
92AppendDevicePathNode (\r
93 IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,\r
94 IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath\r
95 )\r
96;\r
97\r
98/**\r
99 This function appends the device path instance Instance to the device path Source.\r
100 If Source is NULL, then a new device path with one instance is created. \r
101\r
102 @param Source A pointer to a device path data structure.\r
103 @param Instance A pointer to a device path instance.\r
104\r
105 @return\r
106 A pointer to the new device path.\r
107 If there is not enough temporary pool memory available to complete this function,\r
108 then NULL is returned.\r
109\r
110**/\r
111EFI_DEVICE_PATH_PROTOCOL *\r
112EFIAPI\r
113AppendDevicePathInstance (\r
114 IN CONST EFI_DEVICE_PATH_PROTOCOL *Source,\r
115 IN CONST EFI_DEVICE_PATH_PROTOCOL *Instance\r
116 )\r
117;\r
118\r
119/**\r
120 Function retrieves the next device path instance from a device path data structure.\r
121\r
122 @param DevicePath A pointer to a device path data structure.\r
123 \r
124 @param Size A pointer to the size of a device path instance in bytes.\r
125\r
126 @return\r
127 This function returns a pointer to the current device path instance.\r
128 In addition, it returns the size in bytes of the current device path instance in Size,\r
129 and a pointer to the next device path instance in DevicePath.\r
130 If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.\r
131\r
132**/\r
133EFI_DEVICE_PATH_PROTOCOL *\r
134EFIAPI\r
135GetNextDevicePathInstance (\r
136 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,\r
137 OUT UINTN *Size\r
138 )\r
139;\r
140\r
141/**\r
142 Return TRUE is this is a multi instance device path.\r
143\r
144 @param DevicePath A pointer to a device path data structure.\r
145\r
146 @retval TRUE If DevicePath is multi-instance.\r
147 @retval FALSE If DevicePath is not multi-instance or DevicePath is NULL.\r
148\r
149**/\r
150BOOLEAN\r
151EFIAPI\r
152IsDevicePathMultiInstance (\r
153 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
154 )\r
155;\r
156\r
157/**\r
158 This function retrieves the device path protocol from a handle.\r
159\r
160 @param Handle The handle from which to retrieve the device path protocol.\r
161\r
162 @return\r
163 This function returns the device path protocol from the handle specified by Handle.\r
164 If Handle is NULL or Handle does not contain a device path protocol, then NULL is returned.\r
165\r
166**/\r
167EFI_DEVICE_PATH_PROTOCOL *\r
168EFIAPI\r
169DevicePathFromHandle (\r
170 IN EFI_HANDLE Handle\r
171 )\r
172;\r
173\r
174/**\r
175 This function allocates a device path for a file and appends it to an existing device path.\r
176\r
177 @param Device A pointer to a device handle. This parameter is optional and may be NULL.\r
178 @param FileName A pointer to a Null-terminated Unicode string.\r
179\r
180 @return\r
181 If Device is a valid device handle that contains a device path protocol,\r
182 then a device path for the file specified by FileName is allocated\r
183 and appended to the device path associated with the handle Device. The allocated device path is returned.\r
184 If Device is NULL or Device is a handle that does not support the device path protocol,\r
185 then a device path containing a single device path node for the file specified by FileName\r
186 is allocated and returned.\r
187\r
188**/\r
189EFI_DEVICE_PATH_PROTOCOL *\r
190EFIAPI\r
191FileDevicePath (\r
192 IN EFI_HANDLE Device, OPTIONAL\r
193 IN CONST CHAR16 *FileName\r
194 )\r
195;\r
196\r
197#endif\r