MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / SafeFileOpen

Function SafeFileOpen

Library/OcFileLib/OpenFile.c:28–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26#include <Protocol/SimpleFileSystem.h>
27
28EFI_STATUS
29SafeFileOpen (
30 IN EFI_FILE_PROTOCOL *Protocol,
31 OUT EFI_FILE_PROTOCOL **NewHandle,
32 IN CONST CHAR16 *FileName,
33 IN UINT64 OpenMode,
34 IN UINT64 Attributes
35 )
36{
37 EFI_STATUS Status;
38 UINTN Length;
39
40 DEBUG_CODE_BEGIN ();
41 ASSERT (FileName != NULL);
42 Length = StrLen (FileName);
43 if (Length > 0 && FileName[Length - 1] == L'\\') {
44 DEBUG ((DEBUG_INFO, "OCFS: Filename %s has trailing slash\n", FileName));
45 }
46 DEBUG_CODE_END ();
47
48 Status = Protocol->Open (
49 Protocol,
50 NewHandle,
51 (CHAR16 *) FileName,
52 OpenMode,
53 Attributes
54 );
55
56 return Status;
57}
58
59EFI_STATUS
60EFIAPI

Callers 14

InternalFileExistsFunction · 0.85
InternalLoadDmgFunction · 0.85
FindWritableFileSystemFunction · 0.85
SetFileDataFunction · 0.85
ReadFileFunction · 0.85
ReadFileSizeFunction · 0.85
OcStorageInitFromFsFunction · 0.85

Calls 2

StrLenFunction · 0.50
OpenMethod · 0.45

Tested by

no test coverage detected