2 OpenVolume() function of Simple File System Protocol.
4 Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
13 Implements Simple File System Protocol interface function OpenVolume().
15 @param This - Calling context.
16 @param File - the Root Directory of the volume.
18 @retval EFI_OUT_OF_RESOURCES - Can not allocate the memory.
19 @retval EFI_VOLUME_CORRUPTED - The FAT type is error.
20 @retval EFI_SUCCESS - Open the volume successfully.
26 IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
*This
,
27 OUT EFI_FILE_PROTOCOL
**File
34 Volume
= VOLUME_FROM_VOL_INTERFACE (This
);
40 Status
= FatOpenDirEnt (NULL
, &Volume
->RootDirEnt
);
41 if (EFI_ERROR (Status
)) {
46 // Open a new instance to the root
48 Status
= FatAllocateIFile (Volume
->Root
, &IFile
);
49 if (!EFI_ERROR (Status
)) {
50 *File
= &IFile
->Handle
;
55 Status
= FatCleanupVolume (Volume
, Volume
->Root
, Status
, NULL
);