OcFileLib: Standardise Function Names (#287)

This commit is contained in:
dakanji 2021-08-31 10:33:34 +03:00 committed by GitHub
parent d039dae40d
commit dee3ff5ef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 178 additions and 178 deletions

View File

@ -69,7 +69,7 @@ LoadOpenCore (
RootPathLength = PrefixPathSize / sizeof (CHAR16) - 1;
LoaderPath[RootPathLength] = '\\';
CopyMem (&LoaderPath[RootPathLength + 1], OPEN_CORE_APP_PATH, L_STR_SIZE (OPEN_CORE_APP_PATH));
Buffer = ReadFile (FileSystem, LoaderPath, &BufferSize, BASE_16MB);
Buffer = OcReadFile (FileSystem, LoaderPath, &BufferSize, BASE_16MB);
DEBUG ((DEBUG_INFO, "BS: Startup path - %s (%p)\n", LoaderPath, Buffer));
if (Buffer != NULL) {
@ -96,7 +96,7 @@ LoadOpenCore (
OPEN_CORE_ROOT_PATH L"\\" OPEN_CORE_APP_PATH
));
Buffer = ReadFile (
Buffer = OcReadFile (
FileSystem,
OPEN_CORE_ROOT_PATH L"\\" OPEN_CORE_APP_PATH,
&BufferSize,
@ -173,7 +173,7 @@ UefiMain (
//
// Obtain the file system device path
//
FileSystem = LocateFileSystem (
FileSystem = OcLocateFileSystem (
LoadedImage->DeviceHandle,
LoadedImage->FilePath
);

View File

@ -439,7 +439,7 @@ UefiMain (
(UINT32) Date.Second
);
SetFileData (NULL, Filename, FinalReport, (UINT32) AsciiStrLen (FinalReport));
OcSetFileData (NULL, Filename, FinalReport, (UINT32) AsciiStrLen (FinalReport));
FreePool (FinalReport);
} else {

View File

@ -335,7 +335,7 @@ UefiMain (
//
// Obtain the file system device path
//
FileSystem = LocateFileSystem (
FileSystem = OcLocateFileSystem (
LoadedImage->DeviceHandle,
LoadedImage->FilePath
);

View File

@ -48,7 +48,7 @@ typedef struct {
@retval simple file system protocol or NULL.
**/
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *
LocateFileSystem (
OcLocateFileSystem (
IN EFI_HANDLE DeviceHandle OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL *FilePath OPTIONAL
);
@ -62,7 +62,7 @@ LocateFileSystem (
@retval opened file protocol or NULL.
**/
EFI_FILE_PROTOCOL *
LocateRootVolume (
OcLocateRootVolume (
IN EFI_HANDLE DeviceHandle OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL *FilePath OPTIONAL
);
@ -75,7 +75,7 @@ LocateRootVolume (
@retval simple file system protocol or NULL.
**/
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *
LocateFileSystemByGuid (
OcLocateFileSystemByGuid (
IN CONST GUID *Guid
);
@ -87,7 +87,7 @@ LocateFileSystemByGuid (
@retval A pointer to the NULL terminated unicode volume label.
**/
CHAR16 *
GetVolumeLabel (
OcGetVolumeLabel (
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem
);
@ -115,7 +115,7 @@ GetVolumeLabel (
@retval EFI_SUCCESS for successfully opened file.
*/
EFI_STATUS
SafeFileOpen (
OcSafeFileOpen (
IN EFI_FILE_PROTOCOL *Protocol,
OUT EFI_FILE_PROTOCOL **NewHandle,
IN CONST CHAR16 *FileName,
@ -136,7 +136,7 @@ SafeFileOpen (
@retval A pointer to a buffer containing file read or NULL.
**/
VOID *
ReadFile (
OcReadFile (
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem,
IN CONST CHAR16 *FilePath,
OUT UINT32 *FileSize OPTIONAL,
@ -156,7 +156,7 @@ ReadFile (
@retval A pointer to a buffer containing file read or NULL.
**/
VOID *
ReadFileFromFile (
OcReadFileFromFile (
IN EFI_FILE_PROTOCOL *RootFile,
IN CONST CHAR16 *FilePath,
OUT UINT32 *FileSize OPTIONAL,
@ -173,7 +173,7 @@ ReadFileFromFile (
@retval EFI_SUCCESS on success.
**/
EFI_STATUS
ReadFileSize (
OcReadFileSize (
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem,
IN CONST CHAR16 *FilePath,
OUT UINT32 *Size
@ -190,7 +190,7 @@ ReadFileSize (
@retval EFI_SUCCESS on success.
**/
EFI_STATUS
GetFileData (
OcGetFileData (
IN EFI_FILE_PROTOCOL *File,
IN UINT32 Position,
IN UINT32 Size,
@ -209,7 +209,7 @@ GetFileData (
@retval EFI_SUCCESS on success.
**/
EFI_STATUS
SetFileData (
OcSetFileData (
IN EFI_FILE_PROTOCOL *WritableFs OPTIONAL,
IN CONST CHAR16 *FileName,
IN CONST VOID *Buffer,
@ -226,7 +226,7 @@ SetFileData (
@retval EFI_SUCCESS on success.
**/
EFI_STATUS
AllocateCopyFileData (
OcAllocateCopyFileData (
IN EFI_FILE_PROTOCOL *File,
OUT UINT8 **Buffer,
OUT UINT32 *BufferSize
@ -238,7 +238,7 @@ AllocateCopyFileData (
@param[in,out] Context A pointer to the DIRECTORY_SEARCH_CONTEXT.
**/
VOID
DirectorySeachContextInit (
OcDirectorySeachContextInit (
IN OUT DIRECTORY_SEARCH_CONTEXT *Context
);
@ -253,7 +253,7 @@ DirectorySeachContextInit (
@retval EFI_SUCCESS on success.
**/
EFI_STATUS
GetNewestFileFromDirectory (
OcGetNewestFileFromDirectory (
IN OUT DIRECTORY_SEARCH_CONTEXT *Context,
IN EFI_FILE_PROTOCOL *Directory,
IN CHAR16 *FileNameStartsWith OPTIONAL,
@ -271,7 +271,7 @@ GetNewestFileFromDirectory (
@retval read file info or NULL.
**/
VOID *
GetFileInfo (
OcGetFileInfo (
IN EFI_FILE_PROTOCOL *File,
IN EFI_GUID *InformationType,
IN UINTN MinFileInfoSize,
@ -287,7 +287,7 @@ GetFileInfo (
@retval EFI_SUCCESS on success.
**/
EFI_STATUS
GetFileSize (
OcGetFileSize (
IN EFI_FILE_PROTOCOL *File,
OUT UINT32 *Size
);
@ -301,7 +301,7 @@ GetFileSize (
@retval EFI_SUCCESS on success.
**/
EFI_STATUS
GetFileModificationTime (
OcGetFileModificationTime (
IN EFI_FILE_PROTOCOL *File,
OUT EFI_TIME *Time
);
@ -315,7 +315,7 @@ GetFileModificationTime (
@retval TRUE on success.
**/
BOOLEAN
IsWritableFileSystem (
OcIsWritableFileSystem (
IN EFI_FILE_PROTOCOL *Fs
);
@ -327,7 +327,7 @@ IsWritableFileSystem (
@retval EFI_SUCCESS on success.
**/
EFI_STATUS
FindWritableFileSystem (
OcFindWritableFileSystem (
IN OUT EFI_FILE_PROTOCOL **WritableFs
);
@ -339,7 +339,7 @@ FindWritableFileSystem (
@retval EFI_SUCCESS on success.
**/
EFI_STATUS
FindWritableOcFileSystem (
OcFindWritableOcFileSystem (
OUT EFI_FILE_PROTOCOL **FileSystem
);
@ -508,7 +508,7 @@ OcGetGptPartitionEntry (
@retval NULL on failure (e.g. when a file is not present).
**/
EFI_DEVICE_PATH_PROTOCOL *
CreateFvFileDevicePath (
OcCreateFvFileDevicePath (
IN EFI_GUID *FileGuid
);
@ -523,7 +523,7 @@ CreateFvFileDevicePath (
@retval NULL on failure (e.g. when a file is not present).
**/
VOID *
ReadFvFileSection (
OcReadFvFileSection (
IN EFI_GUID *FileGuid,
IN UINT8 SectionType,
OUT UINT32 *FileSize

View File

@ -1353,7 +1353,7 @@ MachoGetVtableSymbolsFromSmcp64 (
/**
Returns whether the Relocation's type indicates a Pair for the Intel 32
platform.
@param[in] Type The Relocation's type to verify.
**/
@ -1365,7 +1365,7 @@ MachoRelocationIsPairIntel32 (
/**
Returns whether the Relocation's type indicates a Pair for the Intel 64
platform.
@param[in] Type The Relocation's type to verify.
**/
@ -1377,7 +1377,7 @@ MachoRelocationIsPairIntel64 (
/**
Returns whether the Relocation's type matches a Pair's for the Intel 64
platform.
@param[in] Type The Relocation's type to verify.
**/
@ -1388,7 +1388,7 @@ MachoIsRelocationPairTypeIntel64 (
/**
Returns whether the Relocation shall be preserved for the Intel 64 platform.
@param[in] Type The Relocation's type to verify.
**/
@ -1541,7 +1541,7 @@ MachoGetIndirectSymbolTable64 (
Returns a pointer to the Mach-O file at the specified virtual address.
@param[in,out] Context Context of the Mach-O.
@param[in] Address Virtual address to look up.
@param[in] Address Virtual address to look up.
@param[out] MaxSize Maximum data safely available from FileOffset.
If NULL is returned, the output is undefined.
@ -1680,7 +1680,7 @@ FatFilterArchitecture32 (
@param[in,out] FileData Pointer to pointer of the file's data.
@param[in,out] FileSize Pointer to file size of FileData.
@return EFI_SUCCESS if no FAT, or a valid 64-bit arch exists.
**/
EFI_STATUS

View File

@ -41,7 +41,7 @@ AcpiDumpTable (
{
CHAR16 TempName[16];
UnicodeSPrint (TempName, sizeof (TempName), L"%a.aml", Name);
return SetFileData (Root, TempName, Data, (UINT32) Size);
return OcSetFileData (Root, TempName, Data, (UINT32) Size);
}
STATIC
@ -78,7 +78,7 @@ AcpiGetTableName (
for (Index = 0; Index < 256; ++Index) {
UnicodeSPrint (TempName, sizeof (TempName), L"%a-%u.aml", Name, (UINT32) (Index + 1));
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Root,
&TmpFile,
TempName,

View File

@ -156,7 +156,7 @@ InternalFileExists (
EFI_STATUS Status;
EFI_FILE_HANDLE FileHandle;
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Root,
&FileHandle,
FileName,
@ -185,7 +185,7 @@ InternalGetApfsSpecialFileInfo (
}
if (VolumeInfo != NULL) {
*VolumeInfo = GetFileInfo (
*VolumeInfo = OcGetFileInfo (
Root,
&gAppleApfsVolumeInfoGuid,
sizeof (**VolumeInfo),
@ -208,7 +208,7 @@ InternalGetApfsSpecialFileInfo (
}
if (ContainerInfo != NULL) {
*ContainerInfo = GetFileInfo (
*ContainerInfo = OcGetFileInfo (
Root,
&gAppleApfsContainerInfoGuid,
sizeof (**ContainerInfo),
@ -244,7 +244,7 @@ InternalGetBooterFromBlessedSystemFilePath (
{
UINTN FilePathSize;
*FilePath = (EFI_DEVICE_PATH_PROTOCOL *) GetFileInfo (
*FilePath = (EFI_DEVICE_PATH_PROTOCOL *) OcGetFileInfo (
Root,
&gAppleBlessedSystemFileInfoGuid,
sizeof (EFI_DEVICE_PATH_PROTOCOL),
@ -292,7 +292,7 @@ InternalGetBooterFromBlessedSystemFolderPath (
Status = EFI_NOT_FOUND;
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) GetFileInfo (
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) OcGetFileInfo (
Root,
&gAppleBlessedSystemFolderInfoGuid,
sizeof (EFI_DEVICE_PATH_PROTOCOL),
@ -504,7 +504,7 @@ InternalGetBooterFromApfsVolumePredefinedPathList (
EFI_FILE_PROTOCOL *VolumeDirectoryHandle;
EFI_FILE_INFO *VolumeDirectoryInfo;
Status = SafeFileOpen (
Status = OcSafeFileOpen (
PrebootRoot,
&VolumeDirectoryHandle,
VolumeDirectoryName,
@ -519,7 +519,7 @@ InternalGetBooterFromApfsVolumePredefinedPathList (
DEBUG ((DEBUG_BULK_INFO, "OCBP: Found partition %s on preboot\n", VolumeDirectoryName));
}
VolumeDirectoryInfo = GetFileInfo (
VolumeDirectoryInfo = OcGetFileInfo (
VolumeDirectoryHandle,
&gEfiFileInfoGuid,
sizeof (*VolumeDirectoryInfo),
@ -1325,7 +1325,7 @@ OcBootPolicyGetApfsRecoveryFilePath (
PathName
);
Status = SafeFileOpen (
Status = OcSafeFileOpen (
*Root,
&NewHandle,
FullPathBuffer,
@ -1339,7 +1339,7 @@ OcBootPolicyGetApfsRecoveryFilePath (
continue;
}
FileInfo = GetFileInfo (
FileInfo = OcGetFileInfo (
NewHandle,
&gEfiFileInfoGuid,
sizeof (*FileInfo),
@ -1577,7 +1577,7 @@ OcBootPolicyGetAllApfsRecoveryFilePath (
&VolumeInfo[Index3].VolumeGuid
);
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Root,
&NewHandle,
VolumePathName,
@ -1589,7 +1589,7 @@ OcBootPolicyGetAllApfsRecoveryFilePath (
continue;
}
FileInfo = GetFileInfo (
FileInfo = OcGetFileInfo (
NewHandle,
&gEfiFileInfoGuid,
sizeof (*FileInfo),

View File

@ -207,7 +207,7 @@ OcAppleDiskImageInitializeFromFile (
ASSERT (Context != NULL);
ASSERT (File != NULL);
Status = GetFileSize (File, &FileSize);
Status = OcGetFileSize (File, &FileSize);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCDI: Failed to retrieve DMG file size\n"));
return FALSE;

View File

@ -213,7 +213,7 @@ ScanExtensions (
//
// Parse Info.plist.
//
Status = AllocateCopyFileData (FilePlist, (UINT8**)&InfoPlist, &InfoPlistSize);
Status = OcAllocateCopyFileData (FilePlist, (UINT8**)&InfoPlist, &InfoPlistSize);
FilePlist->Close (FilePlist);
if (EFI_ERROR (Status)) {
FileKext->Close (FileKext);
@ -1100,7 +1100,7 @@ CachelessContextOverlayExtensionsDir (
//
// Create directory overlay.
//
Status = GetFileModificationTime (Context->ExtensionsDir, &ModificationTime);
Status = OcGetFileModificationTime (Context->ExtensionsDir, &ModificationTime);
if (EFI_ERROR (Status)) {
ZeroMem (&ModificationTime, sizeof (ModificationTime));
}
@ -1441,7 +1441,7 @@ CachelessContextHookBuiltin (
//
// Open Info.plist
//
Status = AllocateCopyFileData (File, (UINT8 **) &Buffer, &BufferSize);
Status = OcAllocateCopyFileData (File, (UINT8 **) &Buffer, &BufferSize);
if (EFI_ERROR (Status)) {
return Status;
}
@ -1503,7 +1503,7 @@ CachelessContextHookBuiltin (
//
// Virtualize newly created Info.plist.
//
Status = GetFileModificationTime (File, &ModificationTime);
Status = OcGetFileModificationTime (File, &ModificationTime);
if (EFI_ERROR (Status)) {
ZeroMem (&ModificationTime, sizeof (ModificationTime));
}
@ -1528,7 +1528,7 @@ CachelessContextHookBuiltin (
return EFI_INVALID_PARAMETER;
}
Status = AllocateCopyFileData (File, (UINT8 **) &Buffer, &BufferSize);
Status = OcAllocateCopyFileData (File, (UINT8 **) &Buffer, &BufferSize);
if (EFI_ERROR (Status)) {
return Status;
}
@ -1586,7 +1586,7 @@ CachelessContextHookBuiltin (
//
// Virtualize patched binary.
//
Status = GetFileModificationTime (File, &ModificationTime);
Status = OcGetFileModificationTime (File, &ModificationTime);
if (EFI_ERROR (Status)) {
ZeroMem (&ModificationTime, sizeof (ModificationTime));
}

View File

@ -93,7 +93,7 @@ KernelGetFileData (
while (RemainingSize > 0) {
ChunkSize = MIN (RemainingSize, Size);
Status = GetFileData (
Status = OcGetFileData (
File,
mKernelDigestPosition,
ChunkSize,
@ -109,7 +109,7 @@ KernelGetFileData (
}
}
Status = GetFileData (
Status = OcGetFileData (
File,
Position,
Size,
@ -151,7 +151,7 @@ ParseFatArchitecture (
EFI_STATUS Status;
UINT32 FileSize;
Status = GetFileSize (File, &FileSize);
Status = OcGetFileSize (File, &FileSize);
if (EFI_ERROR (Status)) {
return Status;
}
@ -341,7 +341,7 @@ ReadAppleKernelImage (
//
// Figure out size for a non fat image.
//
Status = GetFileSize (File, KernelSize);
Status = OcGetFileSize (File, KernelSize);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCAK: Kernel size cannot be determined - %r\n", Status));
return EFI_OUT_OF_RESOURCES;
@ -465,7 +465,7 @@ ReadAppleKernel (
*Is32Bit = Arch == KernelArch32;
if (mNeedKernelDigest) {
Status = GetFileSize (File, &FullSize);
Status = OcGetFileSize (File, &FullSize);
if (EFI_ERROR (Status)) {
mNeedKernelDigest = FALSE;
FreePool (*Kernel);
@ -533,7 +533,7 @@ ReadAppleMkext (
return EFI_OUT_OF_RESOURCES;
}
Status = GetFileData (File, 0, TmpMkextSize, TmpMkext);
Status = OcGetFileData (File, 0, TmpMkextSize, TmpMkext);
if (EFI_ERROR (Status)) {
FreePool (TmpMkext);
return Status;
@ -554,7 +554,7 @@ ReadAppleMkext (
if (TmpMkext == NULL) {
return EFI_OUT_OF_RESOURCES;
}
Status = GetFileData (File, Offset, TmpMkextSize, TmpMkext);
Status = OcGetFileData (File, Offset, TmpMkextSize, TmpMkext);
if (EFI_ERROR (Status)) {
FreePool (TmpMkext);
return Status;

View File

@ -262,12 +262,12 @@ InternalReadFile (
ASSERT (FilePath != NULL);
ASSERT (FileSize != NULL);
Status = SafeFileOpen (Volume, &FileHandle, FilePath, EFI_FILE_MODE_READ, 0);
Status = OcSafeFileOpen (Volume, &FileHandle, FilePath, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR (Status)) {
return NULL;
}
Status = GetFileSize (FileHandle, &FileReadSize);
Status = OcGetFileSize (FileHandle, &FileReadSize);
if (EFI_ERROR (Status)) {
FileHandle->Close (FileHandle);
return NULL;
@ -279,7 +279,7 @@ InternalReadFile (
return NULL;
}
Status = GetFileData (
Status = OcGetFileData (
FileHandle,
0,
FileReadSize,

View File

@ -582,7 +582,7 @@ OcAudioDump (
//
if (FileBuffer != NULL) {
UnicodeSPrint (TmpFileName, sizeof (TmpFileName), L"Controller%u.txt", Index);
Status = SetFileData (Root, TmpFileName, FileBuffer, (UINT32) AsciiStrLen (FileBuffer));
Status = OcSetFileData (Root, TmpFileName, FileBuffer, (UINT32) AsciiStrLen (FileBuffer));
DEBUG ((DEBUG_INFO, "OCAU: Dumped HDA controller %u info result - %r\n", Index, Status));
FreePool (FileBuffer);
@ -687,7 +687,7 @@ OcAudioDump (
//
if (FileBuffer != NULL) {
UnicodeSPrint (TmpFileName, sizeof (TmpFileName), L"Codec%u.txt", Index);
Status = SetFileData (Root, TmpFileName, FileBuffer, (UINT32) AsciiStrLen (FileBuffer));
Status = OcSetFileData (Root, TmpFileName, FileBuffer, (UINT32) AsciiStrLen (FileBuffer));
DEBUG ((DEBUG_INFO, "OCAU: Dumped HDA codec %u info result - %r\n", Index, Status));
FreePool (FileBuffer);

View File

@ -52,7 +52,7 @@ InternalGetAppleDiskLabel (
UnicodeSPrint (DiskLabelPath, DiskLabelPathSize, L"%s%s", BootDirectoryName, LabelFilename);
DEBUG ((DEBUG_INFO, "OCB: Trying to get label from %s\n", DiskLabelPath));
AsciiDiskLabel = (CHAR8 *) ReadFile (FileSystem, DiskLabelPath, &DiskLabelLength, OC_MAX_VOLUME_LABEL_SIZE);
AsciiDiskLabel = (CHAR8 *) OcReadFile (FileSystem, DiskLabelPath, &DiskLabelLength, OC_MAX_VOLUME_LABEL_SIZE);
FreePool (DiskLabelPath);
if (AsciiDiskLabel != NULL) {
@ -90,7 +90,7 @@ InternalGetContentFlavour (
UnicodeSPrint (ContentFlavourPath, ContentFlavourPathSize, L"%s%s", BootDirectoryName, FlavourFilename);
DEBUG ((DEBUG_INFO, "OCB: Trying to get flavour from %s\n", ContentFlavourPath));
AsciiContentFlavour = (CHAR8 *) ReadFile (FileSystem, ContentFlavourPath, &ContentFlavourLength, OC_MAX_CONTENT_FLAVOUR_SIZE);
AsciiContentFlavour = (CHAR8 *) OcReadFile (FileSystem, ContentFlavourPath, &ContentFlavourLength, OC_MAX_CONTENT_FLAVOUR_SIZE);
FreePool (ContentFlavourPath);
if (AsciiContentFlavour != NULL) {
@ -122,7 +122,7 @@ InternalGetAppleImage (
UnicodeSPrint (ImagePath, ImagePathSize, L"%s%s", DirectoryName, LabelFilename);
DEBUG ((DEBUG_INFO, "OCB: Trying to get image from %s\n", ImagePath));
*ImageData = ReadFile (FileSystem, ImagePath, DataSize, BASE_16MB);
*ImageData = OcReadFile (FileSystem, ImagePath, DataSize, BASE_16MB);
FreePool (ImagePath);
@ -246,7 +246,7 @@ InternalGetAppleVersion (
UnicodeSPrint (SystemVersionPath, SystemVersionPathSize, L"%s%s", DirectoryName, L"SystemVersion.plist");
DEBUG ((DEBUG_INFO, "OCB: Trying to get Apple version from %s\n", SystemVersionPath));
SystemVersionData = (CHAR8 *) ReadFile (FileSystem, SystemVersionPath, &SystemVersionDataSize, BASE_1MB);
SystemVersionData = (CHAR8 *) OcReadFile (FileSystem, SystemVersionPath, &SystemVersionDataSize, BASE_1MB);
FreePool (SystemVersionPath);
if (SystemVersionData != NULL) {
@ -292,7 +292,7 @@ InternalGetRecoveryOsBooter (
FilePathSize = 0;
if (!Basic) {
*FilePath = (EFI_DEVICE_PATH_PROTOCOL *) GetFileInfo (
*FilePath = (EFI_DEVICE_PATH_PROTOCOL *) OcGetFileInfo (
Root,
&gAppleBlessedOsxFolderInfoGuid,
sizeof (EFI_DEVICE_PATH_PROTOCOL),
@ -313,7 +313,7 @@ InternalGetRecoveryOsBooter (
// This is to prevent recovery and volume duplicates on HFS+ systems.
//
TmpPath = (EFI_DEVICE_PATH_PROTOCOL *) GetFileInfo (
TmpPath = (EFI_DEVICE_PATH_PROTOCOL *) OcGetFileInfo (
Root,
&gAppleBlessedSystemFolderInfoGuid,
sizeof (EFI_DEVICE_PATH_PROTOCOL),
@ -356,7 +356,7 @@ InternalGetRecoveryOsBooter (
// Their SlingShot.efi app just bruteforces com.apple.recovery.boot directory existence,
// and we have to copy.
//
Status = SafeFileOpen (Root, &Recovery, L"\\com.apple.recovery.boot", EFI_FILE_MODE_READ, 0);
Status = OcSafeFileOpen (Root, &Recovery, L"\\com.apple.recovery.boot", EFI_FILE_MODE_READ, 0);
if (!EFI_ERROR (Status)) {
//
// Do not do any extra checks for simplicity, as they will be done later either way.
@ -680,7 +680,7 @@ InternalDescribeBootEntry (
//
if (BootEntry->Type == OC_BOOT_UNKNOWN && BootEntry->IsGeneric) {
DEBUG ((DEBUG_INFO, "OCB: Trying to detect Microsoft BCD\n"));
Status = ReadFileSize (FileSystem, L"\\EFI\\Microsoft\\Boot\\BCD", &BcdSize);
Status = OcReadFileSize (FileSystem, L"\\EFI\\Microsoft\\Boot\\BCD", &BcdSize);
if (!EFI_ERROR (Status)) {
BootEntry->Type = OC_BOOT_WINDOWS;
}
@ -691,7 +691,7 @@ InternalDescribeBootEntry (
}
if (BootEntry->Name == NULL) {
BootEntry->Name = GetVolumeLabel (FileSystem);
BootEntry->Name = OcGetVolumeLabel (FileSystem);
if (BootEntry->Name != NULL) {
if (StrCmp (BootEntry->Name, L"Recovery HD") == 0
|| StrCmp (BootEntry->Name, L"Recovery") == 0) {

View File

@ -158,7 +158,7 @@ ExpandShortFormBootPath (
//
// Retrieve file info to determine potentially bootable state.
//
FileInfo = GetFileInfo (
FileInfo = OcGetFileInfo (
File,
&gEfiFileInfoGuid,
sizeof (EFI_FILE_INFO),
@ -233,7 +233,7 @@ IsOpenCoreBootloader (
return FALSE;
}
Status = GetFileData (
Status = OcGetFileData (
File,
OpenCoreMagicOffset,
sizeof (FileReadMagic),

View File

@ -369,7 +369,7 @@ InternalLoadDmg (
return NULL;
}
Status = SafeFileOpen (
Status = OcSafeFileOpen (
DmgDir,
&DmgFile,
DmgFileInfo->FileName,
@ -389,7 +389,7 @@ InternalLoadDmg (
return NULL;
}
Status = GetFileSize (DmgFile, &DmgFileSize);
Status = OcGetFileSize (DmgFile, &DmgFileSize);
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_INFO,
@ -431,7 +431,7 @@ InternalLoadDmg (
DmgFileNameLen
);
if (ChunklistFileInfo != NULL) {
Status = SafeFileOpen (
Status = OcSafeFileOpen (
DmgDir,
&ChunklistFile,
ChunklistFileInfo->FileName,
@ -439,14 +439,14 @@ InternalLoadDmg (
0
);
if (!EFI_ERROR (Status)) {
Status = GetFileSize (ChunklistFile, &ChunklistFileSize);
Status = OcGetFileSize (ChunklistFile, &ChunklistFileSize);
if (Status == EFI_SUCCESS) {
ChunklistBuffer = AllocatePool (ChunklistFileSize);
if (ChunklistBuffer == NULL) {
ChunklistFileSize = 0;
} else {
Status = GetFileData (ChunklistFile, 0, ChunklistFileSize, ChunklistBuffer);
Status = OcGetFileData (ChunklistFile, 0, ChunklistFileSize, ChunklistBuffer);
if (EFI_ERROR (Status)) {
FreePool (ChunklistBuffer);
ChunklistBuffer = NULL;

View File

@ -101,7 +101,7 @@ InternalEfiLoadImageFile (
return EFI_NOT_FOUND;
}
Status = GetFileSize (
Status = OcGetFileSize (
File,
&Size
);
@ -116,7 +116,7 @@ InternalEfiLoadImageFile (
return EFI_OUT_OF_RESOURCES;
}
Status = GetFileData (
Status = OcGetFileData (
File,
0,
Size,

View File

@ -396,7 +396,7 @@ OcRunFirmwareApplication (
DEBUG ((DEBUG_INFO, "OCB: run fw app attempting to find %g...\n", ApplicationGuid));
Dp = CreateFvFileDevicePath (ApplicationGuid);
Dp = OcCreateFvFileDevicePath (ApplicationGuid);
if (Dp != NULL) {
DEBUG ((DEBUG_INFO, "OCB: run fw app attempting to load %g...\n", ApplicationGuid));
NewHandle = NULL;

View File

@ -289,7 +289,7 @@ OcLogAddEntry (
//
if ((OcLog->Options & OC_LOG_FILE) != 0 && OcLog->FileSystem != NULL) {
if (EfiGetCurrentTpl () <= TPL_CALLBACK) {
SetFileData (
OcSetFileData (
OcLog->FileSystem,
OcLog->FilePath,
Private->AsciiBuffer,
@ -448,14 +448,14 @@ OcConfigureLogProtocol (
Status = LogFileSystem->OpenVolume (LogFileSystem, &LogRoot);
if (EFI_ERROR (Status)) {
LogRoot = NULL;
} else if (!IsWritableFileSystem (LogRoot)) {
} else if (!OcIsWritableFileSystem (LogRoot)) {
LogRoot->Close (LogRoot);
LogRoot = NULL;
}
}
if (LogRoot == NULL) {
Status = FindWritableFileSystem (&LogRoot);
Status = OcFindWritableFileSystem (&LogRoot);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "OCL: There is no place to write log file to - %r\n", Status));
LogRoot = NULL;
@ -537,7 +537,7 @@ OcConfigureLogProtocol (
if (LogRoot != NULL) {
if (!EFI_ERROR (Status)) {
if (OC_LOG_PRIVATE_DATA_FROM_OC_LOG_THIS (OcLog)->AsciiBufferSize > 0) {
SetFileData (
OcSetFileData (
LogRoot,
LogPath,
OC_LOG_PRIVATE_DATA_FROM_OC_LOG_THIS (OcLog)->AsciiBuffer,

View File

@ -198,7 +198,7 @@ OcCpuInfoDump (
//
if (FileBuffer != NULL) {
UnicodeSPrint (TmpFileName, sizeof (TmpFileName), L"CPUInfo.txt");
Status = SetFileData (Root, TmpFileName, FileBuffer, (UINT32) AsciiStrLen (FileBuffer));
Status = OcSetFileData (Root, TmpFileName, FileBuffer, (UINT32) AsciiStrLen (FileBuffer));
DEBUG ((DEBUG_INFO, "OCDM: Dumped CPU info - %r\n", Status));
FreePool (FileBuffer);

View File

@ -150,7 +150,7 @@ OcPciInfoDump (
//
if (FileBuffer != NULL) {
UnicodeSPrint (TmpFileName, sizeof (TmpFileName), L"PCIInfo.txt");
Status = SetFileData (Root, TmpFileName, FileBuffer, (UINT32) AsciiStrLen (FileBuffer));
Status = OcSetFileData (Root, TmpFileName, FileBuffer, (UINT32) AsciiStrLen (FileBuffer));
DEBUG ((DEBUG_INFO, "OCDM: Dumped PCI info - %r\n", Status));
FreePool (FileBuffer);

View File

@ -75,7 +75,7 @@ EfiTimeToEpoch (
}
EFI_STATUS
GetFileData (
OcGetFileData (
IN EFI_FILE_PROTOCOL *File,
IN UINT32 Position,
IN UINT32 Size,
@ -120,7 +120,7 @@ GetFileData (
}
EFI_STATUS
GetFileSize (
OcGetFileSize (
IN EFI_FILE_PROTOCOL *File,
OUT UINT32 *Size
)
@ -135,7 +135,7 @@ GetFileSize (
// Some drivers, like EfiFs, return EFI_UNSUPPORTED when trying to seek
// past the file size. Use slow method via attributes for them.
//
FileInfo = GetFileInfo (File, &gEfiFileInfoGuid, sizeof (*FileInfo), NULL);
FileInfo = OcGetFileInfo (File, &gEfiFileInfoGuid, sizeof (*FileInfo), NULL);
if (FileInfo != NULL) {
if ((UINT32) FileInfo->FileSize == FileInfo->FileSize) {
*Size = (UINT32) FileInfo->FileSize;
@ -162,14 +162,14 @@ GetFileSize (
}
EFI_STATUS
GetFileModificationTime (
OcGetFileModificationTime (
IN EFI_FILE_PROTOCOL *File,
OUT EFI_TIME *Time
)
{
EFI_FILE_INFO *FileInfo;
FileInfo = GetFileInfo (File, &gEfiFileInfoGuid, 0, NULL);
FileInfo = OcGetFileInfo (File, &gEfiFileInfoGuid, 0, NULL);
if (FileInfo == NULL) {
return EFI_INVALID_PARAMETER;
}
@ -181,7 +181,7 @@ GetFileModificationTime (
}
BOOLEAN
IsWritableFileSystem (
OcIsWritableFileSystem (
IN EFI_FILE_PROTOCOL *Fs
)
{
@ -191,7 +191,7 @@ IsWritableFileSystem (
//
// We cannot test if the file system is writeable without attempting to create some file.
//
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Fs,
&File,
L"octest.fil",
@ -201,7 +201,7 @@ IsWritableFileSystem (
if (EFI_ERROR (Status)) {
return FALSE;
}
//
// Delete the temporary file and report the found file system.
//
@ -210,7 +210,7 @@ IsWritableFileSystem (
}
EFI_STATUS
FindWritableFileSystem (
OcFindWritableFileSystem (
IN OUT EFI_FILE_PROTOCOL **WritableFs
)
{
@ -250,7 +250,7 @@ FindWritableFileSystem (
));
continue;
}
Status = SimpleFs->OpenVolume (SimpleFs, &Fs);
if (EFI_ERROR (Status)) {
DEBUG ((
@ -262,7 +262,7 @@ FindWritableFileSystem (
continue;
}
if (IsWritableFileSystem (Fs)) {
if (OcIsWritableFileSystem (Fs)) {
FreePool (HandleBuffer);
*WritableFs = Fs;
return EFI_SUCCESS;
@ -280,7 +280,7 @@ FindWritableFileSystem (
}
EFI_STATUS
FindWritableOcFileSystem (
OcFindWritableOcFileSystem (
OUT EFI_FILE_PROTOCOL **FileSystem
)
{
@ -300,7 +300,7 @@ FindWritableOcFileSystem (
}
if (PreferedHandle != NULL) {
*FileSystem = LocateRootVolume (PreferedHandle, NULL);
*FileSystem = OcLocateRootVolume (PreferedHandle, NULL);
} else {
*FileSystem = NULL;
}
@ -308,14 +308,14 @@ FindWritableOcFileSystem (
DEBUG ((DEBUG_INFO, "OCFS: Preferred handle is %p found fs %p\n", PreferedHandle, *FileSystem));
if (*FileSystem == NULL) {
return FindWritableFileSystem (FileSystem);
return OcFindWritableFileSystem (FileSystem);
}
return EFI_SUCCESS;
}
EFI_STATUS
SetFileData (
OcSetFileData (
IN EFI_FILE_PROTOCOL *WritableFs OPTIONAL,
IN CONST CHAR16 *FileName,
IN CONST VOID *Buffer,
@ -331,7 +331,7 @@ SetFileData (
ASSERT (Buffer != NULL);
if (WritableFs == NULL) {
Status = FindWritableFileSystem (&Fs);
Status = OcFindWritableFileSystem (&Fs);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_VERBOSE, "OCFS: WriteFileData can't find writable FS\n"));
return Status;
@ -340,7 +340,7 @@ SetFileData (
Fs = WritableFs;
}
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Fs,
&File,
(CHAR16 *) FileName,
@ -371,13 +371,13 @@ SetFileData (
if (WritableFs == NULL) {
Fs->Close (Fs);
}
}
return Status;
}
EFI_STATUS
AllocateCopyFileData (
OcAllocateCopyFileData (
IN EFI_FILE_PROTOCOL *File,
OUT UINT8 **Buffer,
OUT UINT32 *BufferSize
@ -390,7 +390,7 @@ AllocateCopyFileData (
//
// Get full file data.
//
Status = GetFileSize (File, &ReadSize);
Status = OcGetFileSize (File, &ReadSize);
if (EFI_ERROR (Status)) {
return Status;
}
@ -399,7 +399,7 @@ AllocateCopyFileData (
if (FileBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
Status = GetFileData (File, 0, ReadSize, FileBuffer);
Status = OcGetFileData (File, 0, ReadSize, FileBuffer);
if (EFI_ERROR (Status)) {
FreePool (FileBuffer);
return Status;
@ -411,7 +411,7 @@ AllocateCopyFileData (
}
VOID
DirectorySeachContextInit (
OcDirectorySeachContextInit (
IN OUT DIRECTORY_SEARCH_CONTEXT *Context
)
{
@ -421,7 +421,7 @@ DirectorySeachContextInit (
}
EFI_STATUS
GetNewestFileFromDirectory (
OcGetNewestFileFromDirectory (
IN OUT DIRECTORY_SEARCH_CONTEXT *Context,
IN EFI_FILE_PROTOCOL *Directory,
IN CHAR16 *FileNameStartsWith OPTIONAL,
@ -448,7 +448,7 @@ GetNewestFileFromDirectory (
//
// Ensure this is a directory.
//
FileInfoCurrent = GetFileInfo (Directory, &gEfiFileInfoGuid, 0, NULL);
FileInfoCurrent = OcGetFileInfo (Directory, &gEfiFileInfoGuid, 0, NULL);
if (FileInfoCurrent == NULL) {
return EFI_INVALID_PARAMETER;
}

View File

@ -160,7 +160,7 @@ GetFvFileData (
}
EFI_DEVICE_PATH_PROTOCOL *
CreateFvFileDevicePath (
OcCreateFvFileDevicePath (
IN EFI_GUID *FileGuid
)
{
@ -183,7 +183,7 @@ CreateFvFileDevicePath (
}
VOID *
ReadFvFileSection (
OcReadFvFileSection (
IN EFI_GUID *FileGuid,
IN UINT8 SectionType,
OUT UINT32 *FileSize

View File

@ -30,7 +30,7 @@
#include <Library/OcGuardLib.h>
VOID *
GetFileInfo (
OcGetFileInfo (
IN EFI_FILE_PROTOCOL *File,
IN EFI_GUID *InformationType,
IN UINTN MinFileInfoSize,

View File

@ -32,7 +32,7 @@
#include <Library/UefiLib.h>
CHAR16 *
GetVolumeLabel (
OcGetVolumeLabel (
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem
)
{
@ -54,7 +54,7 @@ GetVolumeLabel (
return NULL;
}
VolumeInfo = GetFileInfo (
VolumeInfo = OcGetFileInfo (
Volume,
&gEfiFileSystemVolumeLabelInfoIdGuid,
sizeof (EFI_FILE_SYSTEM_VOLUME_LABEL),

View File

@ -26,7 +26,7 @@
#include <Library/UefiBootServicesTableLib.h>
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *
LocateFileSystem (
OcLocateFileSystem (
IN EFI_HANDLE DeviceHandle OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL *FilePath OPTIONAL
)
@ -77,7 +77,7 @@ LocateFileSystem (
}
EFI_FILE_PROTOCOL *
LocateRootVolume (
OcLocateRootVolume (
IN EFI_HANDLE DeviceHandle OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL *FilePath OPTIONAL
)
@ -86,7 +86,7 @@ LocateRootVolume (
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem;
EFI_FILE_PROTOCOL *RootVolume;
FileSystem = LocateFileSystem (DeviceHandle, FilePath);
FileSystem = OcLocateFileSystem (DeviceHandle, FilePath);
if (FileSystem == NULL) {
return NULL;
}
@ -100,7 +100,7 @@ LocateRootVolume (
}
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *
LocateFileSystemByGuid (
OcLocateFileSystemByGuid (
IN CONST GUID *Guid
)
{

View File

@ -26,7 +26,7 @@
#include <Protocol/SimpleFileSystem.h>
EFI_STATUS
SafeFileOpen (
OcSafeFileOpen (
IN EFI_FILE_PROTOCOL *Protocol,
OUT EFI_FILE_PROTOCOL **NewHandle,
IN CONST CHAR16 *FileName,
@ -162,7 +162,7 @@ OcOpenFileByRemainingDevicePath (
//
// Open or create the file corresponding to the next pathname fragment.
//
Status = SafeFileOpen (
Status = OcSafeFileOpen (
LastFile,
&NextFile,
PathName,

View File

@ -30,7 +30,7 @@
#include <Library/OcGuardLib.h>
VOID *
ReadFile (
OcReadFile (
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem,
IN CONST CHAR16 *FilePath,
OUT UINT32 *FileSize OPTIONAL,
@ -55,7 +55,7 @@ ReadFile (
return NULL;
}
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Volume,
&FileHandle,
(CHAR16 *) FilePath,
@ -69,7 +69,7 @@ ReadFile (
return NULL;
}
Status = GetFileSize (
Status = OcGetFileSize (
FileHandle,
&FileReadSize
);
@ -82,7 +82,7 @@ ReadFile (
FileBuffer = AllocatePool (FileBufferSize);
if (FileBuffer != NULL) {
Status = GetFileData (
Status = OcGetFileData (
FileHandle,
0,
FileReadSize,
@ -106,7 +106,7 @@ ReadFile (
}
EFI_STATUS
ReadFileSize (
OcReadFileSize (
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem,
IN CONST CHAR16 *FilePath,
OUT UINT32 *Size
@ -128,7 +128,7 @@ ReadFileSize (
return Status;
}
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Volume,
&FileHandle,
(CHAR16 *) FilePath,
@ -142,7 +142,7 @@ ReadFileSize (
return Status;
}
Status = GetFileSize (
Status = OcGetFileSize (
FileHandle,
Size
);
@ -151,7 +151,7 @@ ReadFileSize (
}
VOID *
ReadFileFromFile (
OcReadFileFromFile (
IN EFI_FILE_PROTOCOL *RootFile,
IN CONST CHAR16 *FilePath,
OUT UINT32 *FileSize OPTIONAL,
@ -166,7 +166,7 @@ ReadFileFromFile (
ASSERT (RootFile != NULL);
ASSERT (FilePath != NULL);
Status = SafeFileOpen (
Status = OcSafeFileOpen (
RootFile,
&File,
(CHAR16 *) FilePath,
@ -178,7 +178,7 @@ ReadFileFromFile (
return NULL;
}
Status = GetFileSize (File, &Size);
Status = OcGetFileSize (File, &Size);
if (EFI_ERROR (Status)
|| Size >= MAX_UINT32 - 1
|| (MaxFileSize > 0 && Size > MaxFileSize)) {
@ -192,7 +192,7 @@ ReadFileFromFile (
return NULL;
}
Status = GetFileData (File, 0, Size, FileBuffer);
Status = OcGetFileData (File, 0, Size, FileBuffer);
File->Close (File);
if (EFI_ERROR (Status)) {
FreePool (FileBuffer);

View File

@ -331,7 +331,7 @@ OcKernelLoadAndReserveKext (
UnicodeUefiSlashes (FullPath);
if (IsForced) {
Kext->PlistData = ReadFileFromFile (
Kext->PlistData = OcReadFileFromFile (
RootFile,
FullPath,
&Kext->PlistDataSize,
@ -388,7 +388,7 @@ OcKernelLoadAndReserveKext (
UnicodeUefiSlashes (FullPath);
if (IsForced) {
Kext->ImageData = ReadFileFromFile (
Kext->ImageData = OcReadFileFromFile (
RootFile,
FullPath,
&Kext->ImageDataSize,
@ -978,7 +978,7 @@ OcKernelFuzzyMatch (
}
CopyMem (FileNameDir, FileName, StrnSizeS (FileName, FileNameDirLength) - sizeof (*FileName));
Status = SafeFileOpen (RootFile, &FileDirectory, FileNameDir, EFI_FILE_MODE_READ, 0);
Status = OcSafeFileOpen (RootFile, &FileDirectory, FileNameDir, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR (Status)) {
FreePool (FileNameDir);
return Status;
@ -987,9 +987,9 @@ OcKernelFuzzyMatch (
//
// Search for kernelcache files, trying each one.
//
DirectorySeachContextInit (&Context);
OcDirectorySeachContextInit (&Context);
do {
Status = GetNewestFileFromDirectory (
Status = OcGetNewestFileFromDirectory (
&Context,
FileDirectory,
L"kernelcache",
@ -1021,7 +1021,7 @@ OcKernelFuzzyMatch (
break;
}
Status = SafeFileOpen (RootFile, KernelFile, FileNameCacheNew, OpenMode, Attributes);
Status = OcSafeFileOpen (RootFile, KernelFile, FileNameCacheNew, OpenMode, Attributes);
if (EFI_ERROR (Status)) {
continue;
}
@ -1086,7 +1086,7 @@ OcKernelFileOpen (
if (mCustomKernelDirectoryInProgress) {
DEBUG ((DEBUG_INFO, "OC: Skipping OpenFile hooking on ESP Kernels directory\n"));
return SafeFileOpen (This, NewHandle, FileName, OpenMode, Attributes);
return OcSafeFileOpen (This, NewHandle, FileName, OpenMode, Attributes);
}
//
@ -1127,7 +1127,7 @@ OcKernelFileOpen (
return Status;
}
Status = SafeFileOpen (This, NewHandle, FileName, OpenMode, Attributes);
Status = OcSafeFileOpen (This, NewHandle, FileName, OpenMode, Attributes);
DEBUG ((
DEBUG_VERBOSE,
@ -1208,7 +1208,7 @@ OcKernelFileOpen (
DEBUG ((DEBUG_INFO, "OC: Filename after redirection: %s\n", NewFileName));
mCustomKernelDirectoryInProgress = TRUE;
Status = SafeFileOpen (mCustomKernelDirectory, &EspNewHandle, NewFileName, OpenMode, Attributes);
Status = OcSafeFileOpen (mCustomKernelDirectory, &EspNewHandle, NewFileName, OpenMode, Attributes);
mCustomKernelDirectoryInProgress = FALSE;
if (!EFI_ERROR (Status)) {
(*NewHandle)->Close (*NewHandle);
@ -1290,7 +1290,7 @@ OcKernelFileOpen (
DEBUG ((DEBUG_INFO, "OC: Prelinked status - %r\n", PrelinkedStatus));
Status = GetFileModificationTime (*NewHandle, &ModificationTime);
Status = OcGetFileModificationTime (*NewHandle, &ModificationTime);
if (EFI_ERROR (Status)) {
ZeroMem (&ModificationTime, sizeof (ModificationTime));
}
@ -1379,7 +1379,7 @@ OcKernelFileOpen (
);
DEBUG ((DEBUG_INFO, "OC: Mkext status - %r\n", Status));
if (!EFI_ERROR (Status)) {
Status = GetFileModificationTime (*NewHandle, &ModificationTime);
Status = OcGetFileModificationTime (*NewHandle, &ModificationTime);
if (EFI_ERROR (Status)) {
ZeroMem (&ModificationTime, sizeof (ModificationTime));
}
@ -1505,7 +1505,7 @@ OcLoadKernelSupport (
//
mCustomKernelDirectory = NULL;
if (mOcConfiguration->Kernel.Scheme.CustomKernel) {
Status = FindWritableOcFileSystem (&Root);
Status = OcFindWritableOcFileSystem (&Root);
if (!EFI_ERROR (Status)) {
//
// Open Kernels directory.

View File

@ -97,20 +97,20 @@ ProduceDebugReport (
OcCpuScanProcessor (&CpuInfo);
if (VolumeHandle != NULL) {
Fs = LocateRootVolume (VolumeHandle, NULL);
Fs = OcLocateRootVolume (VolumeHandle, NULL);
} else {
Fs = NULL;
}
if (Fs == NULL) {
Status = FindWritableFileSystem (&Fs);
Status = OcFindWritableFileSystem (&Fs);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OC: No usable filesystem for report - %r\n", Status));
return EFI_NOT_FOUND;
}
}
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Fs,
&SysReport,
L"SysReport",
@ -124,7 +124,7 @@ ProduceDebugReport (
return EFI_ALREADY_STARTED;
}
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Fs,
&SysReport,
L"SysReport",
@ -137,7 +137,7 @@ ProduceDebugReport (
return Status;
}
Status = SafeFileOpen (
Status = OcSafeFileOpen (
SysReport,
&SubReport,
L"ACPI",
@ -151,7 +151,7 @@ ProduceDebugReport (
}
DEBUG ((DEBUG_INFO, "OC: ACPI dumping - %r\n", Status));
Status = SafeFileOpen (
Status = OcSafeFileOpen (
SysReport,
&SubReport,
L"SMBIOS",
@ -165,7 +165,7 @@ ProduceDebugReport (
}
DEBUG ((DEBUG_INFO, "OC: SMBIOS dumping - %r\n", Status));
Status = SafeFileOpen (
Status = OcSafeFileOpen (
SysReport,
&SubReport,
L"Audio",
@ -179,7 +179,7 @@ ProduceDebugReport (
}
DEBUG ((DEBUG_INFO, "OC: Audio dumping - %r\n", Status));
Status = SafeFileOpen (
Status = OcSafeFileOpen (
SysReport,
&SubReport,
L"CPU",
@ -193,7 +193,7 @@ ProduceDebugReport (
}
DEBUG ((DEBUG_INFO, "OC: CPUInfo dumping - %r\n", Status));
Status = SafeFileOpen (
Status = OcSafeFileOpen (
SysReport,
&SubReport,
L"PCI",
@ -313,7 +313,7 @@ SavePanicLog (
&RootFs
);
if (!EFI_ERROR (Status)) {
Status = SetFileData (RootFs, PanicLogName, PanicLog, PanicLogSize);
Status = OcSetFileData (RootFs, PanicLogName, PanicLog, PanicLogSize);
RootFs->Close (RootFs);
}
@ -629,7 +629,7 @@ OcMiscMiddleInit (
(VOID **) &FileSystem
);
if (!EFI_ERROR (Status)) {
LauncherData = ReadFile (FileSystem, FullLauncherPath, &LauncherSize, BASE_32MB);
LauncherData = OcReadFile (FileSystem, FullLauncherPath, &LauncherSize, BASE_32MB);
if (LauncherData != NULL) {
Sha1 (Signature, LauncherData, LauncherSize);
DEBUG ((

View File

@ -283,7 +283,7 @@ OcLoadLegacyNvram (
Schema = &Config->Nvram.Legacy;
FileBuffer = ReadFile (FileSystem, OPEN_CORE_NVRAM_PATH, &FileSize, BASE_1MB);
FileBuffer = OcReadFile (FileSystem, OPEN_CORE_NVRAM_PATH, &FileSize, BASE_1MB);
if (FileBuffer == NULL) {
DEBUG ((DEBUG_INFO, "OC: Invalid nvram data\n"));
return;

View File

@ -46,9 +46,9 @@ OcSmbiosDump (
);
if (!EFI_ERROR (Status)) {
Status = SetFileData (Root, L"EntryV1.bin", OriginalSmbios, OriginalSmbios->EntryPointLength);
Status = OcSetFileData (Root, L"EntryV1.bin", OriginalSmbios, OriginalSmbios->EntryPointLength);
DEBUG ((DEBUG_INFO, "OCSMB: Dumped V1 EP (%u bytes) - %r\n", OriginalSmbios->EntryPointLength, Status));
Status = SetFileData (Root, L"DataV1.bin", (VOID *) (UINTN) OriginalSmbios->TableAddress, OriginalSmbios->TableLength);
Status = OcSetFileData (Root, L"DataV1.bin", (VOID *) (UINTN) OriginalSmbios->TableAddress, OriginalSmbios->TableLength);
DEBUG ((DEBUG_INFO, "OCSMB: Dumped V1 DATA (%u bytes) - %r\n", OriginalSmbios->TableLength, Status));
} else {
DEBUG ((DEBUG_INFO, "OCSMB: No SMBIOS V1 - %r\n", Status));
@ -60,9 +60,9 @@ OcSmbiosDump (
);
if (!EFI_ERROR (Status)) {
Status = SetFileData (Root, L"EntryV3.bin", OriginalSmbios3, OriginalSmbios3->EntryPointLength);
Status = OcSetFileData (Root, L"EntryV3.bin", OriginalSmbios3, OriginalSmbios3->EntryPointLength);
DEBUG ((DEBUG_INFO, "OCSMB: Dumped V3 EP (%u bytes) - %r\n", OriginalSmbios3->EntryPointLength, Status));
Status = SetFileData (Root, L"DataV3.bin", (VOID *) (UINTN) OriginalSmbios3->TableAddress, OriginalSmbios3->TableMaximumSize);
Status = OcSetFileData (Root, L"DataV3.bin", (VOID *) (UINTN) OriginalSmbios3->TableAddress, OriginalSmbios3->TableMaximumSize);
DEBUG ((DEBUG_INFO, "OCSMB: Dumped V3 DATA (%u bytes) - %r\n", OriginalSmbios3->TableMaximumSize, Status));
} else {
DEBUG ((DEBUG_INFO, "OCSMB: No SMBIOS V3 - %r\n", Status));

View File

@ -243,7 +243,7 @@ OcStorageInitFromFs (
return Status;
}
Status = SafeFileOpen (
Status = OcSafeFileOpen (
RootVolume,
&Context->Storage,
(CHAR16 *) StorageRoot,
@ -364,7 +364,7 @@ OcStorageExistsFileUnicode (
return FALSE;
}
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Context->Storage,
&File,
(CHAR16 *) FilePath,
@ -415,7 +415,7 @@ OcStorageReadFileUnicode (
return NULL;
}
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Context->Storage,
&File,
(CHAR16 *) FilePath,
@ -427,7 +427,7 @@ OcStorageReadFileUnicode (
return NULL;
}
Status = GetFileSize (File, &Size);
Status = OcGetFileSize (File, &Size);
if (EFI_ERROR (Status) || Size >= MAX_UINT32 - 1) {
File->Close (File);
return NULL;
@ -439,7 +439,7 @@ OcStorageReadFileUnicode (
return NULL;
}
Status = GetFileData (File, 0, Size, FileBuffer);
Status = OcGetFileData (File, 0, Size, FileBuffer);
File->Close (File);
if (EFI_ERROR (Status)) {
FreePool (FileBuffer);

View File

@ -59,7 +59,7 @@ VirtualFileOpen (
}
if (Data->OriginalProtocol != NULL) {
Status = SafeFileOpen (
Status = OcSafeFileOpen (
Data->OriginalProtocol,
NewHandle,
FileName,

View File

@ -161,7 +161,7 @@ TakeScreenshot (
UINTN Index;
UINT8 Temp;
Status = FindWritableOcFileSystem (&Fs);
Status = OcFindWritableOcFileSystem (&Fs);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCSCR: Can't find writable FS - %r\n", Status));
ShowStatus (0xFF, 0xFF, 0x00); ///< Yellow
@ -285,7 +285,7 @@ TakeScreenshot (
//
// Write PNG image into the file.
//
Status = SetFileData (Fs, FileName, PngFile, (UINT32) PngFileSize);
Status = OcSetFileData (Fs, FileName, PngFile, (UINT32) PngFileSize);
gBS->FreePool (PngFile);
Fs->Close (Fs);
if (EFI_ERROR (Status)) {

View File

@ -673,7 +673,7 @@ DevicePathFromHandle (
}
EFI_FILE_PROTOCOL *
LocateRootVolume (
OcLocateRootVolume (
IN EFI_HANDLE DeviceHandle OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL *FilePath OPTIONAL
)

View File

@ -74,7 +74,7 @@ int main (int argc, char** argv)
DEBUG ((DEBUG_WARN, "BMF: Helvetica failed\n"));
return -1;
}
Result = GuiGetLabel (&Label, &Context, L"Time Machine HD", sizeof ("Time Machine HD") - 1, FALSE);
if (!Result) {
DEBUG ((DEBUG_WARN, "BMF: label failed\n"));
@ -108,4 +108,4 @@ int main (int argc, char** argv)
FreePool (Label.Buffer);
return 0;
}
}

View File

@ -22,7 +22,7 @@ OcGetCurrentMemoryMap (
}
EFI_STATUS
GetFileSize (
OcGetFileSize (
IN EFI_FILE_PROTOCOL *File,
OUT UINT32 *Size
)

View File

@ -503,7 +503,7 @@ UINT8 *Prelinked;
UINT32 PrelinkedSize;
EFI_STATUS
GetFileData (
OcGetFileData (
IN EFI_FILE_PROTOCOL *File,
IN UINT32 Position,
IN UINT32 Size,
@ -521,7 +521,7 @@ GetFileData (
}
EFI_STATUS
GetFileSize (
OcGetFileSize (
IN EFI_FILE_PROTOCOL *File,
OUT UINT32 *Size
)
@ -588,7 +588,7 @@ int wrap_main(int argc, char** argv) {
);
free(TestData);
if (EFI_ERROR (Status)) {
printf (
"OC: Failed to fit kext %s\n",