Last change
on this file since 99404 was 99404, checked in by vboxsync, 20 months ago |
Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643
|
-
Property svn:eol-style
set to
native
|
File size:
1.2 KB
|
Line | |
---|
1 | /** @file
|
---|
2 | OpenVolume() function of Simple File System Protocol.
|
---|
3 |
|
---|
4 | Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
|
---|
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
6 |
|
---|
7 | **/
|
---|
8 |
|
---|
9 | #include "Fat.h"
|
---|
10 |
|
---|
11 | /**
|
---|
12 |
|
---|
13 | Implements Simple File System Protocol interface function OpenVolume().
|
---|
14 |
|
---|
15 | @param This - Calling context.
|
---|
16 | @param File - the Root Directory of the volume.
|
---|
17 |
|
---|
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.
|
---|
21 |
|
---|
22 | **/
|
---|
23 | EFI_STATUS
|
---|
24 | EFIAPI
|
---|
25 | FatOpenVolume (
|
---|
26 | IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
|
---|
27 | OUT EFI_FILE_PROTOCOL **File
|
---|
28 | )
|
---|
29 | {
|
---|
30 | EFI_STATUS Status;
|
---|
31 | FAT_VOLUME *Volume;
|
---|
32 | FAT_IFILE *IFile;
|
---|
33 |
|
---|
34 | Volume = VOLUME_FROM_VOL_INTERFACE (This);
|
---|
35 | FatAcquireLock ();
|
---|
36 |
|
---|
37 | //
|
---|
38 | // Open Root file
|
---|
39 | //
|
---|
40 | Status = FatOpenDirEnt (NULL, &Volume->RootDirEnt);
|
---|
41 | if (EFI_ERROR (Status)) {
|
---|
42 | goto Done;
|
---|
43 | }
|
---|
44 |
|
---|
45 | //
|
---|
46 | // Open a new instance to the root
|
---|
47 | //
|
---|
48 | Status = FatAllocateIFile (Volume->Root, &IFile);
|
---|
49 | if (!EFI_ERROR (Status)) {
|
---|
50 | *File = &IFile->Handle;
|
---|
51 | }
|
---|
52 |
|
---|
53 | Done:
|
---|
54 |
|
---|
55 | Status = FatCleanupVolume (Volume, Volume->Root, Status, NULL);
|
---|
56 | FatReleaseLock ();
|
---|
57 |
|
---|
58 | return Status;
|
---|
59 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.