Allow 11 11.x in IsOSValid().

No timing in JIEF_DEBUG.
This commit is contained in:
jief666 2020-10-20 10:55:46 +03:00
parent c87858c5f0
commit e80852a82f
5 changed files with 45 additions and 23 deletions

View File

@ -273,7 +273,11 @@ MemLogVA (
// Add log to buffer
//
LastMessage = mMemLog->Cursor;
#ifdef JIEF_DEBUG
if (0) {
#else
if (Timing) {
#endif
//
// Write timing only at the beginning of a new line
//
@ -532,7 +536,11 @@ MemLogfVA (
//
UINTN LastMessage = mMemLog->Cursor - mMemLog->Buffer;
#ifdef JIEF_DEBUG
vprintf_with_callback_timestamp_emitcr(Format, Marker, transmitS8Printf, NULL, &printfNewline, 0, 1);
#else
vprintf_with_callback_timestamp_emitcr(Format, Marker, transmitS8Printf, NULL, &printfNewline, Timing, 1);
#endif
size_t DataWritten = mMemLog->Cursor - mMemLog->Buffer - LastMessage;
//

View File

@ -14,20 +14,20 @@
class SelfOem
{
protected:
XString8 m_ConfName;
XString8 m_ConfName = NullXString8; // Initialisation required by -Weffc++. Couldn't use default ctor.
// bool m_OemDirExists;
EFI_FILE* m_OemDir = NULL;
XStringW m_OemPathRelToSelfDir;
XStringW m_OemFulPath;
XStringW m_OemPathRelToSelfDir = NullXStringW;
XStringW m_OemFulPath = NullXStringW;
// const EFI_FILE* m_userConfigDir = NULL;
XStringW m_configDirPathRelToSelfDir; // could also be empty if config dir is clover dir.
XStringW m_configDirPathRelToSelfDirWithTrailingSlash; // could also be empty if config dir is clover dir.
XStringW m_configDirPathRelToSelfDir = NullXStringW; // could also be empty if config dir is clover dir.
XStringW m_configDirPathRelToSelfDirWithTrailingSlash = NullXStringW; // could also be empty if config dir is clover dir.
EFI_FILE* m_KextsDir = NULL;
XStringW m_KextsPathRelToSelfDir;
XStringW m_KextsFullPath;
XStringW m_KextsPathRelToSelfDir = NullXStringW;
XStringW m_KextsFullPath = NullXStringW;
// EFI_STATUS _openDir(const XStringW& path, bool* b, EFI_FILE** efiDir);
bool _checkOEMPath();

View File

@ -1556,6 +1556,14 @@ BOOLEAN IsOSValid(const XString8& MatchOS, const XString8& CurrOS)
XString8Array osToc = Split<XString8Array>(MatchOS, "."_XS8).trimEachString();
XString8Array currOStoc = Split<XString8Array>(CurrOS, "."_XS8).trimEachString();
if ( osToc.size() > 0 && currOStoc.size() > 0 && osToc[0] == "11"_XS8 && currOStoc[0] == "11"_XS8 ) {
if (osToc.size() == 1 ) return true;
if (osToc.size() == 2 ) {
if ( osToc[1].equalIC("x") ) return true;
if ( currOStoc.size() == 2 && osToc[1] == currOStoc[1] ) return true;
}
}
if (osToc.size() == 2) {
if (currOStoc.size() == 2) {
if ( osToc[0] == currOStoc[0] && osToc[1] == currOStoc[1]) {

View File

@ -36,25 +36,31 @@ public:
}
// Overload post/pre increment
void operator++()
Counter& operator++()
{
m_counter++;
return *this;
}
void operator++(int)
{
m_counter++;
}
// Overload post/pre decrement
void operator--()
{
m_counter--;
}
void operator--(int)
// Counter operator++(int)
// {
// Counter tmp = *this;
// m_counter++;
// return tmp;
// }
//
// // Overload post/pre decrement
Counter& operator--()
{
m_counter--;
return *this;
}
// Counter operator--(int)
// {
// Counter tmp = *this;
// m_counter--;
// return tmp;
// }
private:
unsigned int m_counter{};
@ -71,7 +77,7 @@ public:
m_ptr = ptr;
m_counter = new Counter();
if (ptr) {
(*m_counter)++;
++(*m_counter);
}
}
@ -80,7 +86,7 @@ public:
{
m_ptr = sp.m_ptr;
m_counter = sp.m_counter;
(*m_counter)++;
++(*m_counter);
}
// Reference count
@ -107,7 +113,7 @@ public:
// Destructor
~Shared_ptr()
{
(*m_counter)--;
--(*m_counter);
if (m_counter->get() == 0) {
delete m_counter;
delete m_ptr;

View File

@ -21,7 +21,7 @@ class XTheme
public:
XObjArray<XIcon> Icons;
protected:
XStringW m_ThemePath;
XStringW m_ThemePath = NullXStringW;
EFI_FILE *ThemeDir;
public: