dmazar caller is responsible for FreePool the result
| 7892 | //dmazar |
| 7893 | // caller is responsible for FreePool the result |
| 7894 | XStringW |
| 7895 | GetOSVersionKextsDir ( |
| 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 | |
| 7930 | EFI_STATUS |
| 7931 | InjectKextsFromDir ( |
no test coverage detected