2 OpenVolume() function of Simple File System Protocol.
4 Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available
6 under the terms and conditions of the BSD License which accompanies this
7 distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 Implements Simple File System Protocol interface function OpenVolume().
21 @param This - Calling context.
22 @param File - the Root Directory of the volume.
24 @retval EFI_OUT_OF_RESOURCES - Can not allocate the memory.
25 @retval EFI_VOLUME_CORRUPTED - The FAT type is error.
26 @retval EFI_SUCCESS - Open the volume successfully.
32 IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
*This
,
33 OUT EFI_FILE_PROTOCOL
**File
40 Volume
= VOLUME_FROM_VOL_INTERFACE (This
);
46 Status
= FatOpenDirEnt (NULL
, &Volume
->RootDirEnt
);
47 if (EFI_ERROR (Status
)) {
51 // Open a new instance to the root
53 Status
= FatAllocateIFile (Volume
->Root
, &IFile
);
54 if (!EFI_ERROR (Status
)) {
55 *File
= &IFile
->Handle
;
60 Status
= FatCleanupVolume (Volume
, Volume
->Root
, Status
, NULL
);