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

Function GetOSVersionKextsDir

rEFIt_UEFI/Platform/Settings.cpp:7894–7928  ·  view source on GitHub ↗

dmazar caller is responsible for FreePool the result

Source from the content-addressed store, hash-verified

7892//dmazar
7893// caller is responsible for FreePool the result
7894XStringW
7895GetOSVersionKextsDir (
7896 const XString8& OSVersion
7897 )
7898{
7899 XString8 FixedVersion;
7900 CHAR8 *DotPtr;
7901
7902 if (OSVersion.notEmpty()) {
7903 FixedVersion.strncpy(OSVersion.c_str(), 5);
7904 // DBG("%s\n", FixedVersion);
7905 // OSVersion may contain minor version too (can be 10.x or 10.x.y)
7906 if ((DotPtr = AsciiStrStr (FixedVersion.c_str(), ".")) != NULL) {
7907 DotPtr = AsciiStrStr (DotPtr+1, "."); // second dot
7908 }
7909
7910 if (DotPtr != NULL) {
7911 *DotPtr = 0;
7912 }
7913 }
7914
7915 //MsgLog ("OS=%ls\n", OSTypeStr);
7916
7917 // find source injection folder with kexts
7918 // note: we are just checking for existance of particular folder, not checking if it is empty or not
7919 // check OEM subfolders: version specific or default to Other
7920 XStringW SrcDir = SWPrintf("%ls\\kexts\\%s", OEMPath.wc_str(), FixedVersion.c_str());
7921 if (!FileExists (SelfVolume->RootDir, SrcDir)) {
7922 SrcDir = SWPrintf("\\EFI\\CLOVER\\kexts\\%s", FixedVersion.c_str());
7923 if (!FileExists (SelfVolume->RootDir, SrcDir)) {
7924 SrcDir.setEmpty();
7925 }
7926 }
7927 return SrcDir;
7928}
7929
7930EFI_STATUS
7931InjectKextsFromDir (

Callers 1

SetFSInjectionMethod · 0.85

Calls 7

SWPrintfFunction · 0.85
FileExistsFunction · 0.85
strncpyMethod · 0.80
notEmptyMethod · 0.45
c_strMethod · 0.45
wc_strMethod · 0.45
setEmptyMethod · 0.45

Tested by

no test coverage detected