]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Disk/UdfDxe/Udf.h
MdeModulePkg/Udf: Refine function description comments
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / UdfDxe / Udf.h
1 /** @file
2 UDF/ECMA-167 file system driver.
3
4 Copyright (C) 2014-2017 Paulo Alcantara <pcacjr@zytor.com>
5
6 This program and the accompanying materials are licensed and made available
7 under the terms and conditions of the BSD License which accompanies this
8 distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
12 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 **/
14
15 #ifndef _UDF_H_
16 #define _UDF_H_
17
18 #include <Uefi.h>
19 #include <Base.h>
20
21 #include <Protocol/BlockIo.h>
22 #include <Protocol/ComponentName.h>
23 #include <Protocol/DevicePath.h>
24 #include <Protocol/DriverBinding.h>
25 #include <Protocol/DiskIo.h>
26 #include <Protocol/SimpleFileSystem.h>
27
28 #include <Guid/FileInfo.h>
29 #include <Guid/FileSystemInfo.h>
30 #include <Guid/FileSystemVolumeLabelInfo.h>
31
32 #include <Library/DebugLib.h>
33 #include <Library/UefiDriverEntryPoint.h>
34 #include <Library/BaseLib.h>
35 #include <Library/UefiLib.h>
36 #include <Library/BaseMemoryLib.h>
37 #include <Library/MemoryAllocationLib.h>
38 #include <Library/UefiBootServicesTableLib.h>
39 #include <Library/DevicePathLib.h>
40
41 #include <IndustryStandard/ElTorito.h>
42 #include <IndustryStandard/Udf.h>
43
44 //
45 // C5BD4D42-1A76-4996-8956-73CDA326CD0A
46 //
47 #define EFI_UDF_DEVICE_PATH_GUID \
48 { 0xC5BD4D42, 0x1A76, 0x4996, \
49 { 0x89, 0x56, 0x73, 0xCD, 0xA3, 0x26, 0xCD, 0x0A } \
50 }
51
52 #define UDF_DEFAULT_LV_NUM 0
53
54 #define IS_PVD(_Pointer) \
55 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 1))
56 #define IS_PD(_Pointer) \
57 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 5))
58 #define IS_LVD(_Pointer) \
59 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 6))
60 #define IS_TD(_Pointer) \
61 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 8))
62 #define IS_FSD(_Pointer) \
63 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 256))
64 #define IS_FE(_Pointer) \
65 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 261))
66 #define IS_EFE(_Pointer) \
67 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 266))
68 #define IS_FID(_Pointer) \
69 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 257))
70 #define IS_AED(_Pointer) \
71 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 258))
72 #define IS_LVID(_Pointer) \
73 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 9))
74
75 #define _GET_FILETYPE(_Pointer) \
76 (IS_FE (_Pointer) ? \
77 (((UDF_FILE_ENTRY *)(_Pointer))->IcbTag.FileType) \
78 : \
79 (((UDF_EXTENDED_FILE_ENTRY *)(_Pointer))->IcbTag.FileType))
80
81 #define IS_FE_DIRECTORY(_Pointer) \
82 ((BOOLEAN)(_GET_FILETYPE (_Pointer) == 4))
83 #define IS_FE_STANDARD_FILE(_Pointer) \
84 ((BOOLEAN)(_GET_FILETYPE (_Pointer) == 5))
85 #define IS_FE_SYMLINK(_Pointer) \
86 ((BOOLEAN)(_GET_FILETYPE (_Pointer) == 12))
87
88 #define HIDDEN_FILE (1 << 0)
89 #define DIRECTORY_FILE (1 << 1)
90 #define DELETED_FILE (1 << 2)
91 #define PARENT_FILE (1 << 3)
92
93 #define _GET_FILE_CHARS(_Pointer) \
94 (((UDF_FILE_IDENTIFIER_DESCRIPTOR *)(_Pointer))->FileCharacteristics)
95
96 #define IS_FID_HIDDEN_FILE(_Pointer) \
97 ((BOOLEAN)(_GET_FILE_CHARS (_Pointer) & HIDDEN_FILE))
98 #define IS_FID_DIRECTORY_FILE(_Pointer) \
99 ((BOOLEAN)(_GET_FILE_CHARS (_Pointer) & DIRECTORY_FILE))
100 #define IS_FID_DELETED_FILE(_Pointer) \
101 ((BOOLEAN)(_GET_FILE_CHARS (_Pointer) & DELETED_FILE))
102 #define IS_FID_PARENT_FILE(_Pointer) \
103 ((BOOLEAN)(_GET_FILE_CHARS (_Pointer) & PARENT_FILE))
104 #define IS_FID_NORMAL_FILE(_Pointer) \
105 ((BOOLEAN)(!IS_FID_DIRECTORY_FILE (_Pointer) && \
106 !IS_FID_PARENT_FILE (_Pointer)))
107
108 typedef enum {
109 SHORT_ADS_SEQUENCE,
110 LONG_ADS_SEQUENCE,
111 EXTENDED_ADS_SEQUENCE,
112 INLINE_DATA
113 } UDF_FE_RECORDING_FLAGS;
114
115 #define GET_FE_RECORDING_FLAGS(_Fe) \
116 ((UDF_FE_RECORDING_FLAGS)((UDF_ICB_TAG *)( \
117 (UINT8 *)(_Fe) + \
118 sizeof (UDF_DESCRIPTOR_TAG)))->Flags & 0x07)
119
120 typedef enum {
121 EXTENT_RECORDED_AND_ALLOCATED,
122 EXTENT_NOT_RECORDED_BUT_ALLOCATED,
123 EXTENT_NOT_RECORDED_NOT_ALLOCATED,
124 EXTENT_IS_NEXT_EXTENT,
125 } UDF_EXTENT_FLAGS;
126
127 #define AD_LENGTH(_RecFlags) \
128 ((_RecFlags) == SHORT_ADS_SEQUENCE ? \
129 ((UINT64)(sizeof (UDF_SHORT_ALLOCATION_DESCRIPTOR))) : \
130 ((UINT64)(sizeof (UDF_LONG_ALLOCATION_DESCRIPTOR))))
131
132 #define GET_EXTENT_FLAGS(_RecFlags, _Ad) \
133 ((_RecFlags) == SHORT_ADS_SEQUENCE ? \
134 ((UDF_EXTENT_FLAGS)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \
135 30) & 0x3)) : \
136 ((UDF_EXTENT_FLAGS)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \
137 30) & 0x3)))
138
139 #define GET_EXTENT_LENGTH(_RecFlags, _Ad) \
140 ((_RecFlags) == SHORT_ADS_SEQUENCE ? \
141 ((UINT32)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \
142 ~0xC0000000UL))) : \
143 ((UINT32)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \
144 ~0xC0000000UL))))
145
146 #define UDF_FILENAME_LENGTH 128
147 #define UDF_PATH_LENGTH 512
148
149 #define GET_FID_FROM_ADS(_Data, _Offs) \
150 ((UDF_FILE_IDENTIFIER_DESCRIPTOR *)((UINT8 *)(_Data) + (_Offs)))
151
152 #define IS_VALID_COMPRESSION_ID(_CompId) \
153 ((BOOLEAN)((_CompId) == 8 || (_CompId) == 16))
154
155 #define LV_BLOCK_SIZE(_Vol, _LvNum) \
156 (_Vol)->LogicalVolDescs[(_LvNum)]->LogicalBlockSize
157
158 #define UDF_STANDARD_IDENTIFIER_LENGTH 5
159
160 #define LV_UDF_REVISION(_Lv) \
161 *(UINT16 *)(UINTN)(_Lv)->DomainIdentifier.IdentifierSuffix
162
163 #pragma pack(1)
164
165 typedef struct {
166 UINT8 StandardIdentifier[UDF_STANDARD_IDENTIFIER_LENGTH];
167 } UDF_STANDARD_IDENTIFIER;
168
169 #pragma pack()
170
171 typedef enum {
172 READ_FILE_GET_FILESIZE,
173 READ_FILE_ALLOCATE_AND_READ,
174 READ_FILE_SEEK_AND_READ,
175 } UDF_READ_FILE_FLAGS;
176
177 typedef struct {
178 VOID *FileData;
179 UDF_READ_FILE_FLAGS Flags;
180 UINT64 FileDataSize;
181 UINT64 FilePosition;
182 UINT64 FileSize;
183 UINT64 ReadLength;
184 } UDF_READ_FILE_INFO;
185
186 #pragma pack(1)
187
188 typedef struct {
189 UINT8 CharacterSetType;
190 UINT8 CharacterSetInfo[63];
191 } UDF_CHAR_SPEC;
192
193 typedef struct {
194 UINT8 Flags;
195 UINT8 Identifier[23];
196 UINT8 IdentifierSuffix[8];
197 } UDF_ENTITY_ID;
198
199 typedef struct {
200 UINT16 TypeAndTimezone;
201 INT16 Year;
202 UINT8 Month;
203 UINT8 Day;
204 UINT8 Hour;
205 UINT8 Minute;
206 UINT8 Second;
207 UINT8 Centiseconds;
208 UINT8 HundredsOfMicroseconds;
209 UINT8 Microseconds;
210 } UDF_TIMESTAMP;
211
212 typedef struct {
213 UINT32 LogicalBlockNumber;
214 UINT16 PartitionReferenceNumber;
215 } UDF_LB_ADDR;
216
217 typedef struct {
218 UINT32 ExtentLength;
219 UDF_LB_ADDR ExtentLocation;
220 UINT8 ImplementationUse[6];
221 } UDF_LONG_ALLOCATION_DESCRIPTOR;
222
223 typedef struct {
224 UDF_DESCRIPTOR_TAG DescriptorTag;
225 UINT32 PrevAllocationExtentDescriptor;
226 UINT32 LengthOfAllocationDescriptors;
227 } UDF_ALLOCATION_EXTENT_DESCRIPTOR;
228
229 typedef struct {
230 UINT8 StructureType;
231 UINT8 StandardIdentifier[UDF_STANDARD_IDENTIFIER_LENGTH];
232 UINT8 StructureVersion;
233 UINT8 Reserved;
234 UINT8 StructureData[2040];
235 } UDF_VOLUME_DESCRIPTOR;
236
237 typedef struct {
238 UDF_DESCRIPTOR_TAG DescriptorTag;
239 UINT32 VolumeDescriptorSequenceNumber;
240 UINT16 PartitionFlags;
241 UINT16 PartitionNumber;
242 UDF_ENTITY_ID PartitionContents;
243 UINT8 PartitionContentsUse[128];
244 UINT32 AccessType;
245 UINT32 PartitionStartingLocation;
246 UINT32 PartitionLength;
247 UDF_ENTITY_ID ImplementationIdentifier;
248 UINT8 ImplementationUse[128];
249 UINT8 Reserved[156];
250 } UDF_PARTITION_DESCRIPTOR;
251
252 typedef struct {
253 UDF_DESCRIPTOR_TAG DescriptorTag;
254 UINT32 VolumeDescriptorSequenceNumber;
255 UDF_CHAR_SPEC DescriptorCharacterSet;
256 UINT8 LogicalVolumeIdentifier[128];
257 UINT32 LogicalBlockSize;
258 UDF_ENTITY_ID DomainIdentifier;
259 UDF_LONG_ALLOCATION_DESCRIPTOR LogicalVolumeContentsUse;
260 UINT32 MapTableLength;
261 UINT32 NumberOfPartitionMaps;
262 UDF_ENTITY_ID ImplementationIdentifier;
263 UINT8 ImplementationUse[128];
264 UDF_EXTENT_AD IntegritySequenceExtent;
265 UINT8 PartitionMaps[6];
266 } UDF_LOGICAL_VOLUME_DESCRIPTOR;
267
268 typedef struct {
269 UDF_DESCRIPTOR_TAG DescriptorTag;
270 UDF_TIMESTAMP RecordingDateTime;
271 UINT32 IntegrityType;
272 UDF_EXTENT_AD NextIntegrityExtent;
273 UINT8 LogicalVolumeContentsUse[32];
274 UINT32 NumberOfPartitions;
275 UINT32 LengthOfImplementationUse;
276 UINT8 Data[0];
277 } UDF_LOGICAL_VOLUME_INTEGRITY;
278
279 typedef struct {
280 UDF_DESCRIPTOR_TAG DescriptorTag;
281 UDF_TIMESTAMP RecordingDateAndTime;
282 UINT16 InterchangeLevel;
283 UINT16 MaximumInterchangeLevel;
284 UINT32 CharacterSetList;
285 UINT32 MaximumCharacterSetList;
286 UINT32 FileSetNumber;
287 UINT32 FileSetDescriptorNumber;
288 UDF_CHAR_SPEC LogicalVolumeIdentifierCharacterSet;
289 UINT8 LogicalVolumeIdentifier[128];
290 UDF_CHAR_SPEC FileSetCharacterSet;
291 UINT8 FileSetIdentifier[32];
292 UINT8 CopyrightFileIdentifier[32];
293 UINT8 AbstractFileIdentifier[32];
294 UDF_LONG_ALLOCATION_DESCRIPTOR RootDirectoryIcb;
295 UDF_ENTITY_ID DomainIdentifier;
296 UDF_LONG_ALLOCATION_DESCRIPTOR NextExtent;
297 UDF_LONG_ALLOCATION_DESCRIPTOR SystemStreamDirectoryIcb;
298 UINT8 Reserved[32];
299 } UDF_FILE_SET_DESCRIPTOR;
300
301 typedef struct {
302 UINT32 ExtentLength;
303 UINT32 ExtentPosition;
304 } UDF_SHORT_ALLOCATION_DESCRIPTOR;
305
306 typedef struct {
307 UDF_DESCRIPTOR_TAG DescriptorTag;
308 UINT16 FileVersionNumber;
309 UINT8 FileCharacteristics;
310 UINT8 LengthOfFileIdentifier;
311 UDF_LONG_ALLOCATION_DESCRIPTOR Icb;
312 UINT16 LengthOfImplementationUse;
313 UINT8 Data[0];
314 } UDF_FILE_IDENTIFIER_DESCRIPTOR;
315
316 typedef struct {
317 UINT32 PriorRecordNumberOfDirectEntries;
318 UINT16 StrategyType;
319 UINT16 StrategyParameter;
320 UINT16 MaximumNumberOfEntries;
321 UINT8 Reserved;
322 UINT8 FileType;
323 UDF_LB_ADDR ParentIcbLocation;
324 UINT16 Flags;
325 } UDF_ICB_TAG;
326
327 typedef struct {
328 UDF_DESCRIPTOR_TAG DescriptorTag;
329 UDF_ICB_TAG IcbTag;
330 UINT32 Uid;
331 UINT32 Gid;
332 UINT32 Permissions;
333 UINT16 FileLinkCount;
334 UINT8 RecordFormat;
335 UINT8 RecordDisplayAttributes;
336 UINT32 RecordLength;
337 UINT64 InformationLength;
338 UINT64 LogicalBlocksRecorded;
339 UDF_TIMESTAMP AccessTime;
340 UDF_TIMESTAMP ModificationTime;
341 UDF_TIMESTAMP AttributeTime;
342 UINT32 CheckPoint;
343 UDF_LONG_ALLOCATION_DESCRIPTOR ExtendedAttributeIcb;
344 UDF_ENTITY_ID ImplementationIdentifier;
345 UINT64 UniqueId;
346 UINT32 LengthOfExtendedAttributes;
347 UINT32 LengthOfAllocationDescriptors;
348 UINT8 Data[0]; // L_EA + L_AD
349 } UDF_FILE_ENTRY;
350
351 typedef struct {
352 UDF_DESCRIPTOR_TAG DescriptorTag;
353 UDF_ICB_TAG IcbTag;
354 UINT32 Uid;
355 UINT32 Gid;
356 UINT32 Permissions;
357 UINT16 FileLinkCount;
358 UINT8 RecordFormat;
359 UINT8 RecordDisplayAttributes;
360 UINT32 RecordLength;
361 UINT64 InformationLength;
362 UINT64 ObjectSize;
363 UINT64 LogicalBlocksRecorded;
364 UDF_TIMESTAMP AccessTime;
365 UDF_TIMESTAMP ModificationTime;
366 UDF_TIMESTAMP CreationTime;
367 UDF_TIMESTAMP AttributeTime;
368 UINT32 CheckPoint;
369 UINT32 Reserved;
370 UDF_LONG_ALLOCATION_DESCRIPTOR ExtendedAttributeIcb;
371 UDF_LONG_ALLOCATION_DESCRIPTOR StreamDirectoryIcb;
372 UDF_ENTITY_ID ImplementationIdentifier;
373 UINT64 UniqueId;
374 UINT32 LengthOfExtendedAttributes;
375 UINT32 LengthOfAllocationDescriptors;
376 UINT8 Data[0]; // L_EA + L_AD
377 } UDF_EXTENDED_FILE_ENTRY;
378
379 typedef struct {
380 UINT8 ComponentType;
381 UINT8 LengthOfComponentIdentifier;
382 UINT16 ComponentFileVersionNumber;
383 UINT8 ComponentIdentifier[0];
384 } UDF_PATH_COMPONENT;
385
386 #pragma pack()
387
388 //
389 // UDF filesystem driver's private data
390 //
391 typedef struct {
392 UDF_LOGICAL_VOLUME_DESCRIPTOR **LogicalVolDescs;
393 UINTN LogicalVolDescsNo;
394 UDF_PARTITION_DESCRIPTOR **PartitionDescs;
395 UINTN PartitionDescsNo;
396 UDF_FILE_SET_DESCRIPTOR **FileSetDescs;
397 UINTN FileSetDescsNo;
398 UINTN FileEntrySize;
399 } UDF_VOLUME_INFO;
400
401 typedef struct {
402 VOID *FileEntry;
403 UDF_FILE_IDENTIFIER_DESCRIPTOR *FileIdentifierDesc;
404 } UDF_FILE_INFO;
405
406 typedef struct {
407 VOID *DirectoryData;
408 UINT64 DirectoryLength;
409 UINT64 FidOffset;
410 } UDF_READ_DIRECTORY_INFO;
411
412 #define PRIVATE_UDF_FILE_DATA_SIGNATURE SIGNATURE_32 ('U', 'd', 'f', 'f')
413
414 #define PRIVATE_UDF_FILE_DATA_FROM_THIS(a) \
415 CR ( \
416 a, \
417 PRIVATE_UDF_FILE_DATA, \
418 FileIo, \
419 PRIVATE_UDF_FILE_DATA_SIGNATURE \
420 )
421
422 typedef struct {
423 UINTN Signature;
424 BOOLEAN IsRootDirectory;
425 UDF_FILE_INFO *Root;
426 UDF_FILE_INFO File;
427 UDF_READ_DIRECTORY_INFO ReadDirInfo;
428 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFs;
429 EFI_FILE_PROTOCOL FileIo;
430 CHAR16 AbsoluteFileName[UDF_PATH_LENGTH];
431 CHAR16 FileName[UDF_FILENAME_LENGTH];
432 UINT64 FileSize;
433 UINT64 FilePosition;
434 } PRIVATE_UDF_FILE_DATA;
435
436 #define PRIVATE_UDF_SIMPLE_FS_DATA_SIGNATURE SIGNATURE_32 ('U', 'd', 'f', 's')
437
438 #define PRIVATE_UDF_SIMPLE_FS_DATA_FROM_THIS(a) \
439 CR ( \
440 a, \
441 PRIVATE_UDF_SIMPLE_FS_DATA, \
442 SimpleFs, \
443 PRIVATE_UDF_SIMPLE_FS_DATA_SIGNATURE \
444 )
445
446 typedef struct {
447 UINTN Signature;
448 EFI_BLOCK_IO_PROTOCOL *BlockIo;
449 EFI_DISK_IO_PROTOCOL *DiskIo;
450 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL SimpleFs;
451 UDF_VOLUME_INFO Volume;
452 UDF_FILE_INFO Root;
453 UINTN OpenFiles;
454 EFI_HANDLE Handle;
455 } PRIVATE_UDF_SIMPLE_FS_DATA;
456
457 //
458 // Global Variables
459 //
460 extern EFI_DRIVER_BINDING_PROTOCOL gUdfDriverBinding;
461 extern EFI_COMPONENT_NAME_PROTOCOL gUdfComponentName;
462 extern EFI_COMPONENT_NAME2_PROTOCOL gUdfComponentName2;
463
464 //
465 // Function Prototypes
466 //
467
468 /**
469 Open the root directory on a volume.
470
471 @param This Protocol instance pointer.
472 @param Root Returns an Open file handle for the root directory
473
474 @retval EFI_SUCCESS The device was opened.
475 @retval EFI_UNSUPPORTED This volume does not support the file system.
476 @retval EFI_NO_MEDIA The device has no media.
477 @retval EFI_DEVICE_ERROR The device reported an error.
478 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
479 @retval EFI_ACCESS_DENIED The service denied access to the file.
480 @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources.
481
482 **/
483 EFI_STATUS
484 EFIAPI
485 UdfOpenVolume (
486 IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
487 OUT EFI_FILE_PROTOCOL **Root
488 );
489
490 /**
491 Opens a new file relative to the source file's location.
492
493 @param This The protocol instance pointer.
494 @param NewHandle Returns File Handle for FileName.
495 @param FileName Null terminated string. "\", ".", and ".." are supported.
496 @param OpenMode Open mode for file.
497 @param Attributes Only used for EFI_FILE_MODE_CREATE.
498
499 @retval EFI_SUCCESS The device was opened.
500 @retval EFI_NOT_FOUND The specified file could not be found on the device.
501 @retval EFI_NO_MEDIA The device has no media.
502 @retval EFI_MEDIA_CHANGED The media has changed.
503 @retval EFI_DEVICE_ERROR The device reported an error.
504 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
505 @retval EFI_ACCESS_DENIED The service denied access to the file.
506 @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources.
507 @retval EFI_VOLUME_FULL The volume is full.
508
509 **/
510 EFI_STATUS
511 EFIAPI
512 UdfOpen (
513 IN EFI_FILE_PROTOCOL *This,
514 OUT EFI_FILE_PROTOCOL **NewHandle,
515 IN CHAR16 *FileName,
516 IN UINT64 OpenMode,
517 IN UINT64 Attributes
518 );
519
520 /**
521 Read data from the file.
522
523 @param This Protocol instance pointer.
524 @param BufferSize On input size of buffer, on output amount of data in buffer.
525 @param Buffer The buffer in which data is read.
526
527 @retval EFI_SUCCESS Data was read.
528 @retval EFI_NO_MEDIA The device has no media.
529 @retval EFI_DEVICE_ERROR The device reported an error.
530 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
531 @retval EFI_BUFFER_TO_SMALL BufferSize is too small. BufferSize contains required size.
532
533 **/
534 EFI_STATUS
535 EFIAPI
536 UdfRead (
537 IN EFI_FILE_PROTOCOL *This,
538 IN OUT UINTN *BufferSize,
539 OUT VOID *Buffer
540 );
541
542 /**
543 Close the file handle.
544
545 @param This Protocol instance pointer.
546
547 @retval EFI_SUCCESS The file was closed.
548
549 **/
550 EFI_STATUS
551 EFIAPI
552 UdfClose (
553 IN EFI_FILE_PROTOCOL *This
554 );
555
556 /**
557 Close and delete the file handle.
558
559 @param This Protocol instance pointer.
560
561 @retval EFI_SUCCESS The file was closed and deleted.
562 @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not
563 deleted.
564
565 **/
566 EFI_STATUS
567 EFIAPI
568 UdfDelete (
569 IN EFI_FILE_PROTOCOL *This
570 );
571
572 /**
573 Write data to a file.
574
575 @param This Protocol instance pointer.
576 @param BufferSize On input size of buffer, on output amount of data in buffer.
577 @param Buffer The buffer in which data to write.
578
579 @retval EFI_SUCCESS Data was written.
580 @retval EFI_UNSUPPORTED Writes to Open directory are not supported.
581 @retval EFI_NO_MEDIA The device has no media.
582 @retval EFI_DEVICE_ERROR The device reported an error.
583 @retval EFI_DEVICE_ERROR An attempt was made to write to a deleted file.
584 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
585 @retval EFI_WRITE_PROTECTED The device is write protected.
586 @retval EFI_ACCESS_DENIED The file was open for read only.
587 @retval EFI_VOLUME_FULL The volume is full.
588
589 **/
590 EFI_STATUS
591 EFIAPI
592 UdfWrite (
593 IN EFI_FILE_PROTOCOL *This,
594 IN OUT UINTN *BufferSize,
595 IN VOID *Buffer
596 );
597
598 /**
599 Get file's current position.
600
601 @param This Protocol instance pointer.
602 @param Position Byte position from the start of the file.
603
604 @retval EFI_SUCCESS Position was updated.
605 @retval EFI_UNSUPPORTED Seek request for directories is not valid.
606
607 **/
608 EFI_STATUS
609 EFIAPI
610 UdfGetPosition (
611 IN EFI_FILE_PROTOCOL *This,
612 OUT UINT64 *Position
613 );
614
615 /**
616 Set file's current position.
617
618 @param This Protocol instance pointer.
619 @param Position Byte position from the start of the file.
620
621 @retval EFI_SUCCESS Position was updated.
622 @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.
623
624 **/
625 EFI_STATUS
626 EFIAPI
627 UdfSetPosition (
628 IN EFI_FILE_PROTOCOL *This,
629 IN UINT64 Position
630 );
631
632 /**
633 Get information about a file.
634
635 @param This Protocol instance pointer.
636 @param InformationType Type of information to return in Buffer.
637 @param BufferSize On input size of buffer, on output amount of data in buffer.
638 @param Buffer The buffer to return data.
639
640 @retval EFI_SUCCESS Data was returned.
641 @retval EFI_UNSUPPORTED InformationType is not supported.
642 @retval EFI_NO_MEDIA The device has no media.
643 @retval EFI_DEVICE_ERROR The device reported an error.
644 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
645 @retval EFI_WRITE_PROTECTED The device is write protected.
646 @retval EFI_ACCESS_DENIED The file was open for read only.
647 @retval EFI_BUFFER_TOO_SMALL Buffer was too small; required size returned in BufferSize.
648
649 **/
650 EFI_STATUS
651 EFIAPI
652 UdfGetInfo (
653 IN EFI_FILE_PROTOCOL *This,
654 IN EFI_GUID *InformationType,
655 IN OUT UINTN *BufferSize,
656 OUT VOID *Buffer
657 );
658
659 /**
660 Set information about a file.
661
662 @param This Protocol instance pointer.
663 @param InformationType Type of information in Buffer.
664 @param BufferSize Size of buffer.
665 @param Buffer The data to write.
666
667 @retval EFI_SUCCESS Data was set.
668 @retval EFI_UNSUPPORTED InformationType is not supported.
669 @retval EFI_NO_MEDIA The device has no media.
670 @retval EFI_DEVICE_ERROR The device reported an error.
671 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
672 @retval EFI_WRITE_PROTECTED The device is write protected.
673 @retval EFI_ACCESS_DENIED The file was open for read only.
674
675 **/
676 EFI_STATUS
677 EFIAPI
678 UdfSetInfo (
679 IN EFI_FILE_PROTOCOL *This,
680 IN EFI_GUID *InformationType,
681 IN UINTN BufferSize,
682 IN VOID *Buffer
683 );
684
685 /**
686 Flush data back for the file handle.
687
688 @param This Protocol instance pointer.
689
690 @retval EFI_SUCCESS Data was flushed.
691 @retval EFI_UNSUPPORTED Writes to Open directory are not supported.
692 @retval EFI_NO_MEDIA The device has no media.
693 @retval EFI_DEVICE_ERROR The device reported an error.
694 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
695 @retval EFI_WRITE_PROTECTED The device is write protected.
696 @retval EFI_ACCESS_DENIED The file was open for read only.
697 @retval EFI_VOLUME_FULL The volume is full.
698
699 **/
700 EFI_STATUS
701 EFIAPI
702 UdfFlush (
703 IN EFI_FILE_PROTOCOL *This
704 );
705
706 /**
707 Read volume information on a medium which contains a valid UDF file system.
708
709 @param[in] BlockIo BlockIo interface.
710 @param[in] DiskIo DiskIo interface.
711 @param[out] Volume UDF volume information structure.
712
713 @retval EFI_SUCCESS Volume information read.
714 @retval EFI_NO_MEDIA The device has no media.
715 @retval EFI_DEVICE_ERROR The device reported an error.
716 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
717 @retval EFI_OUT_OF_RESOURCES The volume was not read due to lack of resources.
718
719 **/
720 EFI_STATUS
721 ReadUdfVolumeInformation (
722 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
723 IN EFI_DISK_IO_PROTOCOL *DiskIo,
724 OUT UDF_VOLUME_INFO *Volume
725 );
726
727 /**
728 Find the root directory on an UDF volume.
729
730 @param[in] BlockIo BlockIo interface.
731 @param[in] DiskIo DiskIo interface.
732 @param[in] Volume UDF volume information structure.
733 @param[out] File Root directory file.
734
735 @retval EFI_SUCCESS Root directory found.
736 @retval EFI_NO_MEDIA The device has no media.
737 @retval EFI_DEVICE_ERROR The device reported an error.
738 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
739 @retval EFI_OUT_OF_RESOURCES The root directory was not found due to lack of
740 resources.
741
742 **/
743 EFI_STATUS
744 FindRootDirectory (
745 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
746 IN EFI_DISK_IO_PROTOCOL *DiskIo,
747 IN UDF_VOLUME_INFO *Volume,
748 OUT UDF_FILE_INFO *File
749 );
750
751 /**
752 Find either a File Entry or a Extended File Entry from a given ICB.
753
754 @param[in] BlockIo BlockIo interface.
755 @param[in] DiskIo DiskIo interface.
756 @param[in] Volume UDF volume information structure.
757 @param[in] Icb ICB of the FID.
758 @param[out] FileEntry File Entry or Extended File Entry.
759
760 @retval EFI_SUCCESS File Entry or Extended File Entry found.
761 @retval EFI_NO_MEDIA The device has no media.
762 @retval EFI_DEVICE_ERROR The device reported an error.
763 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
764 @retval EFI_OUT_OF_RESOURCES The FE/EFE entry was not found due to lack of
765 resources.
766
767 **/
768 EFI_STATUS
769 FindFileEntry (
770 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
771 IN EFI_DISK_IO_PROTOCOL *DiskIo,
772 IN UDF_VOLUME_INFO *Volume,
773 IN UDF_LONG_ALLOCATION_DESCRIPTOR *Icb,
774 OUT VOID **FileEntry
775 );
776
777 /**
778 Find a file given its absolute path on an UDF volume.
779
780 @param[in] BlockIo BlockIo interface.
781 @param[in] DiskIo DiskIo interface.
782 @param[in] Volume UDF volume information structure.
783 @param[in] FilePath File's absolute path.
784 @param[in] Root Root directory file.
785 @param[in] Parent Parent directory file.
786 @param[in] Icb ICB of Parent.
787 @param[out] File Found file.
788
789 @retval EFI_SUCCESS FilePath was found.
790 @retval EFI_NO_MEDIA The device has no media.
791 @retval EFI_DEVICE_ERROR The device reported an error.
792 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
793 @retval EFI_OUT_OF_RESOURCES The FilePath file was not found due to lack of
794 resources.
795
796 **/
797 EFI_STATUS
798 FindFile (
799 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
800 IN EFI_DISK_IO_PROTOCOL *DiskIo,
801 IN UDF_VOLUME_INFO *Volume,
802 IN CHAR16 *FilePath,
803 IN UDF_FILE_INFO *Root,
804 IN UDF_FILE_INFO *Parent,
805 IN UDF_LONG_ALLOCATION_DESCRIPTOR *Icb,
806 OUT UDF_FILE_INFO *File
807 );
808
809 /**
810 Read a directory entry at a time on an UDF volume.
811
812 @param[in] BlockIo BlockIo interface.
813 @param[in] DiskIo DiskIo interface.
814 @param[in] Volume UDF volume information structure.
815 @param[in] ParentIcb ICB of the parent file.
816 @param[in] FileEntryData FE/EFE of the parent file.
817 @param[in, out] ReadDirInfo Next read directory listing structure
818 information.
819 @param[out] FoundFid File Identifier Descriptor pointer.
820
821 @retval EFI_SUCCESS Directory entry read.
822 @retval EFI_UNSUPPORTED Extended Allocation Descriptors not supported.
823 @retval EFI_NO_MEDIA The device has no media.
824 @retval EFI_DEVICE_ERROR The device reported an error.
825 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
826 @retval EFI_OUT_OF_RESOURCES The directory entry was not read due to lack of
827 resources.
828
829 **/
830 EFI_STATUS
831 ReadDirectoryEntry (
832 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
833 IN EFI_DISK_IO_PROTOCOL *DiskIo,
834 IN UDF_VOLUME_INFO *Volume,
835 IN UDF_LONG_ALLOCATION_DESCRIPTOR *ParentIcb,
836 IN VOID *FileEntryData,
837 IN OUT UDF_READ_DIRECTORY_INFO *ReadDirInfo,
838 OUT UDF_FILE_IDENTIFIER_DESCRIPTOR **FoundFid
839 );
840
841 /**
842 Get a filename (encoded in OSTA-compressed format) from a File Identifier
843 Descriptor on an UDF volume.
844
845 @param[in] FileIdentifierDesc File Identifier Descriptor pointer.
846 @param[out] FileName Decoded filename.
847
848 @retval EFI_SUCCESS Filename decoded and read.
849 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
850 **/
851 EFI_STATUS
852 GetFileNameFromFid (
853 IN UDF_FILE_IDENTIFIER_DESCRIPTOR *FileIdentifierDesc,
854 OUT CHAR16 *FileName
855 );
856
857 /**
858 Resolve a symlink file on an UDF volume.
859
860 @param[in] BlockIo BlockIo interface.
861 @param[in] DiskIo DiskIo interface.
862 @param[in] Volume UDF volume information structure.
863 @param[in] Parent Parent file.
864 @param[in] FileEntryData FE/EFE structure pointer.
865 @param[out] File Resolved file.
866
867 @retval EFI_SUCCESS Symlink file resolved.
868 @retval EFI_UNSUPPORTED Extended Allocation Descriptors not supported.
869 @retval EFI_NO_MEDIA The device has no media.
870 @retval EFI_DEVICE_ERROR The device reported an error.
871 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
872 @retval EFI_OUT_OF_RESOURCES The symlink file was not resolved due to lack of
873 resources.
874
875 **/
876 EFI_STATUS
877 ResolveSymlink (
878 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
879 IN EFI_DISK_IO_PROTOCOL *DiskIo,
880 IN UDF_VOLUME_INFO *Volume,
881 IN UDF_FILE_INFO *Parent,
882 IN VOID *FileEntryData,
883 OUT UDF_FILE_INFO *File
884 );
885
886 /**
887 Clean up in-memory UDF volume information.
888
889 @param[in] Volume Volume information pointer.
890
891 **/
892 VOID
893 CleanupVolumeInformation (
894 IN UDF_VOLUME_INFO *Volume
895 );
896
897 /**
898 Clean up in-memory UDF file information.
899
900 @param[in] File File information pointer.
901
902 **/
903 VOID
904 CleanupFileInformation (
905 IN UDF_FILE_INFO *File
906 );
907
908 /**
909 Find a file from its absolute path on an UDF volume.
910
911 @param[in] BlockIo BlockIo interface.
912 @param[in] DiskIo DiskIo interface.
913 @param[in] Volume UDF volume information structure.
914 @param[in] File File information structure.
915 @param[out] Size Size of the file.
916
917 @retval EFI_SUCCESS File size calculated and set in Size.
918 @retval EFI_UNSUPPORTED Extended Allocation Descriptors not supported.
919 @retval EFI_NO_MEDIA The device has no media.
920 @retval EFI_DEVICE_ERROR The device reported an error.
921 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
922 @retval EFI_OUT_OF_RESOURCES The file size was not calculated due to lack of
923 resources.
924
925 **/
926 EFI_STATUS
927 GetFileSize (
928 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
929 IN EFI_DISK_IO_PROTOCOL *DiskIo,
930 IN UDF_VOLUME_INFO *Volume,
931 IN UDF_FILE_INFO *File,
932 OUT UINT64 *Size
933 );
934
935 /**
936 Set information about a file on an UDF volume.
937
938 @param[in] File File pointer.
939 @param[in] FileSize Size of the file.
940 @param[in] FileName Filename of the file.
941 @param[in, out] BufferSize Size of the returned file infomation.
942 @param[out] Buffer Data of the returned file information.
943
944 @retval EFI_SUCCESS File information set.
945 @retval EFI_NO_MEDIA The device has no media.
946 @retval EFI_DEVICE_ERROR The device reported an error.
947 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
948 @retval EFI_OUT_OF_RESOURCES The file information was not set due to lack of
949 resources.
950
951 **/
952 EFI_STATUS
953 SetFileInfo (
954 IN UDF_FILE_INFO *File,
955 IN UINT64 FileSize,
956 IN CHAR16 *FileName,
957 IN OUT UINTN *BufferSize,
958 OUT VOID *Buffer
959 );
960
961 /**
962 Get volume and free space size information of an UDF volume.
963
964 @param[in] BlockIo BlockIo interface.
965 @param[in] DiskIo DiskIo interface.
966 @param[in] Volume UDF volume information structure.
967 @param[out] VolumeSize Volume size.
968 @param[out] FreeSpaceSize Free space size.
969
970 @retval EFI_SUCCESS Volume and free space size calculated.
971 @retval EFI_NO_MEDIA The device has no media.
972 @retval EFI_DEVICE_ERROR The device reported an error.
973 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
974 @retval EFI_OUT_OF_RESOURCES The volume and free space size were not
975 calculated due to lack of resources.
976
977 **/
978 EFI_STATUS
979 GetVolumeSize (
980 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
981 IN EFI_DISK_IO_PROTOCOL *DiskIo,
982 IN UDF_VOLUME_INFO *Volume,
983 OUT UINT64 *VolumeSize,
984 OUT UINT64 *FreeSpaceSize
985 );
986
987 /**
988 Seek a file and read its data into memory on an UDF volume.
989
990 @param[in] BlockIo BlockIo interface.
991 @param[in] DiskIo DiskIo interface.
992 @param[in] Volume UDF volume information structure.
993 @param[in] File File information structure.
994 @param[in] FileSize Size of the file.
995 @param[in, out] FilePosition File position.
996 @param[in, out] Buffer File data.
997 @param[in, out] BufferSize Read size.
998
999 @retval EFI_SUCCESS File seeked and read.
1000 @retval EFI_UNSUPPORTED Extended Allocation Descriptors not supported.
1001 @retval EFI_NO_MEDIA The device has no media.
1002 @retval EFI_DEVICE_ERROR The device reported an error.
1003 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
1004 @retval EFI_OUT_OF_RESOURCES The file's recorded data was not read due to lack
1005 of resources.
1006
1007 **/
1008 EFI_STATUS
1009 ReadFileData (
1010 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
1011 IN EFI_DISK_IO_PROTOCOL *DiskIo,
1012 IN UDF_VOLUME_INFO *Volume,
1013 IN UDF_FILE_INFO *File,
1014 IN UINT64 FileSize,
1015 IN OUT UINT64 *FilePosition,
1016 IN OUT VOID *Buffer,
1017 IN OUT UINT64 *BufferSize
1018 );
1019
1020 /**
1021 Check if ControllerHandle supports an UDF file system.
1022
1023 @param[in] This Protocol instance pointer.
1024 @param[in] ControllerHandle Handle of device to test.
1025
1026 @retval EFI_SUCCESS UDF file system found.
1027 @retval EFI_UNSUPPORTED UDF file system not found.
1028
1029 **/
1030 EFI_STATUS
1031 SupportUdfFileSystem (
1032 IN EFI_DRIVER_BINDING_PROTOCOL *This,
1033 IN EFI_HANDLE ControllerHandle
1034 );
1035
1036 /**
1037 Mangle a filename by cutting off trailing whitespaces, "\\", "." and "..".
1038
1039 @param[in] FileName Filename.
1040
1041 @retval The mangled Filename.
1042
1043 **/
1044 CHAR16 *
1045 MangleFileName (
1046 IN CHAR16 *FileName
1047 );
1048
1049 /**
1050 Test to see if this driver supports ControllerHandle. Any ControllerHandle
1051 than contains a BlockIo and DiskIo protocol can be supported.
1052
1053 @param This Protocol instance pointer.
1054 @param ControllerHandle Handle of device to test
1055 @param RemainingDevicePath Optional parameter use to pick a specific child
1056 device to start.
1057
1058 @retval EFI_SUCCESS This driver supports this device
1059 @retval EFI_ALREADY_STARTED This driver is already running on this device
1060 @retval other This driver does not support this device
1061
1062 **/
1063 EFI_STATUS
1064 EFIAPI
1065 UdfDriverBindingSupported (
1066 IN EFI_DRIVER_BINDING_PROTOCOL *This,
1067 IN EFI_HANDLE ControllerHandle,
1068 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
1069 );
1070
1071 /**
1072 Start this driver on ControllerHandle by opening a Block IO and Disk IO
1073 protocol, reading Device Path, and creating a child handle with a
1074 Disk IO and device path protocol.
1075
1076 @param This Protocol instance pointer.
1077 @param ControllerHandle Handle of device to bind driver to
1078 @param RemainingDevicePath Optional parameter use to pick a specific child
1079 device to start.
1080
1081 @retval EFI_SUCCESS This driver is added to ControllerHandle
1082 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
1083 @retval other This driver does not support this device
1084
1085 **/
1086 EFI_STATUS
1087 EFIAPI
1088 UdfDriverBindingStart (
1089 IN EFI_DRIVER_BINDING_PROTOCOL *This,
1090 IN EFI_HANDLE ControllerHandle,
1091 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
1092 );
1093
1094 /**
1095 Stop this driver on ControllerHandle. Support stopping any child handles
1096 created by this driver.
1097
1098 @param This Protocol instance pointer.
1099 @param ControllerHandle Handle of device to stop driver on
1100 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
1101 children is zero stop the entire bus driver.
1102 @param ChildHandleBuffer List of Child Handles to Stop.
1103
1104 @retval EFI_SUCCESS This driver is removed ControllerHandle
1105 @retval other This driver was not removed from this device
1106
1107 **/
1108 EFI_STATUS
1109 EFIAPI
1110 UdfDriverBindingStop (
1111 IN EFI_DRIVER_BINDING_PROTOCOL *This,
1112 IN EFI_HANDLE ControllerHandle,
1113 IN UINTN NumberOfChildren,
1114 IN EFI_HANDLE *ChildHandleBuffer
1115 );
1116
1117 //
1118 // EFI Component Name Functions
1119 //
1120 /**
1121 Retrieves a Unicode string that is the user readable name of the driver.
1122
1123 This function retrieves the user readable name of a driver in the form of a
1124 Unicode string. If the driver specified by This has a user readable name in
1125 the language specified by Language, then a pointer to the driver name is
1126 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
1127 by This does not support the language specified by Language,
1128 then EFI_UNSUPPORTED is returned.
1129
1130 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1131 EFI_COMPONENT_NAME_PROTOCOL instance.
1132
1133 @param Language[in] A pointer to a Null-terminated ASCII string
1134 array indicating the language. This is the
1135 language of the driver name that the caller is
1136 requesting, and it must match one of the
1137 languages specified in SupportedLanguages. The
1138 number of languages supported by a driver is up
1139 to the driver writer. Language is specified
1140 in RFC 4646 or ISO 639-2 language code format.
1141
1142 @param DriverName[out] A pointer to the Unicode string to return.
1143 This Unicode string is the name of the
1144 driver specified by This in the language
1145 specified by Language.
1146
1147 @retval EFI_SUCCESS The Unicode string for the Driver specified by
1148 This and the language specified by Language was
1149 returned in DriverName.
1150
1151 @retval EFI_INVALID_PARAMETER Language is NULL.
1152
1153 @retval EFI_INVALID_PARAMETER DriverName is NULL.
1154
1155 @retval EFI_UNSUPPORTED The driver specified by This does not support
1156 the language specified by Language.
1157
1158 **/
1159 EFI_STATUS
1160 EFIAPI
1161 UdfComponentNameGetDriverName (
1162 IN EFI_COMPONENT_NAME_PROTOCOL *This,
1163 IN CHAR8 *Language,
1164 OUT CHAR16 **DriverName
1165 );
1166
1167 /**
1168 Retrieves a Unicode string that is the user readable name of the controller
1169 that is being managed by a driver.
1170
1171 This function retrieves the user readable name of the controller specified by
1172 ControllerHandle and ChildHandle in the form of a Unicode string. If the
1173 driver specified by This has a user readable name in the language specified by
1174 Language, then a pointer to the controller name is returned in ControllerName,
1175 and EFI_SUCCESS is returned. If the driver specified by This is not currently
1176 managing the controller specified by ControllerHandle and ChildHandle,
1177 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
1178 support the language specified by Language, then EFI_UNSUPPORTED is returned.
1179
1180 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1181 EFI_COMPONENT_NAME_PROTOCOL instance.
1182
1183 @param ControllerHandle[in] The handle of a controller that the driver
1184 specified by This is managing. This handle
1185 specifies the controller whose name is to be
1186 returned.
1187
1188 @param ChildHandle[in] The handle of the child controller to retrieve
1189 the name of. This is an optional parameter that
1190 may be NULL. It will be NULL for device
1191 drivers. It will also be NULL for a bus drivers
1192 that wish to retrieve the name of the bus
1193 controller. It will not be NULL for a bus
1194 driver that wishes to retrieve the name of a
1195 child controller.
1196
1197 @param Language[in] A pointer to a Null-terminated ASCII string
1198 array indicating the language. This is the
1199 language of the driver name that the caller is
1200 requesting, and it must match one of the
1201 languages specified in SupportedLanguages. The
1202 number of languages supported by a driver is up
1203 to the driver writer. Language is specified in
1204 RFC 4646 or ISO 639-2 language code format.
1205
1206 @param ControllerName[out] A pointer to the Unicode string to return.
1207 This Unicode string is the name of the
1208 controller specified by ControllerHandle and
1209 ChildHandle in the language specified by
1210 Language from the point of view of the driver
1211 specified by This.
1212
1213 @retval EFI_SUCCESS The Unicode string for the user readable name in
1214 the language specified by Language for the
1215 driver specified by This was returned in
1216 DriverName.
1217
1218 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
1219
1220 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
1221 EFI_HANDLE.
1222
1223 @retval EFI_INVALID_PARAMETER Language is NULL.
1224
1225 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
1226
1227 @retval EFI_UNSUPPORTED The driver specified by This is not currently
1228 managing the controller specified by
1229 ControllerHandle and ChildHandle.
1230
1231 @retval EFI_UNSUPPORTED The driver specified by This does not support
1232 the language specified by Language.
1233
1234 **/
1235 EFI_STATUS
1236 EFIAPI
1237 UdfComponentNameGetControllerName (
1238 IN EFI_COMPONENT_NAME_PROTOCOL *This,
1239 IN EFI_HANDLE ControllerHandle,
1240 IN EFI_HANDLE ChildHandle OPTIONAL,
1241 IN CHAR8 *Language,
1242 OUT CHAR16 **ControllerName
1243 );
1244
1245 #endif // _UDF_H_