3 Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials are licensed and made available
5 under the terms and conditions of the BSD License which accompanies this
6 distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 OpenVolume() function of Simple File System Protocol
30 IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
*This
,
31 OUT EFI_FILE_PROTOCOL
**File
37 Implements Simple File System Protocol interface function OpenVolume().
41 This - Calling context.
42 File - the Root Directory of the volume.
46 EFI_OUT_OF_RESOURCES - Can not allocate the memory.
47 EFI_VOLUME_CORRUPTED - The FAT type is error.
48 EFI_SUCCESS - Open the volume successfully.
56 Volume
= VOLUME_FROM_VOL_INTERFACE (This
);
62 Status
= FatOpenDirEnt (NULL
, &Volume
->RootDirEnt
);
63 if (EFI_ERROR (Status
)) {
67 // Open a new instance to the root
69 Status
= FatAllocateIFile (Volume
->Root
, &IFile
);
70 if (!EFI_ERROR (Status
)) {
71 *File
= &IFile
->Handle
;
76 Status
= FatCleanupVolume (Volume
, Volume
->Root
, Status
, NULL
);