From 61163074fa7165814293ebc18546173dee630cb2 Mon Sep 17 00:00:00 2001 From: Slice Date: Fri, 14 Jun 2024 21:14:48 +0300 Subject: [PATCH 1/8] reduce deprecations Signed-off-by: Slice --- BaseTools/Source/C/Common/CommonLib.c | 8 ++++---- BaseTools/Source/C/Common/EfiUtilityMsgs.c | 6 +++--- BaseTools/Source/C/Common/PcdValueCommon.c | 10 +++++----- BaseTools/Source/C/GenFfs/GenFfs.c | 6 +++--- .../Source/C/VfrCompile/Pccts/antlr/gen.c | 20 +++++++++---------- .../Source/C/VfrCompile/Pccts/antlr/main.c | 10 +++++----- .../Source/C/VfrCompile/Pccts/antlr/mrhoist.c | 4 ++-- .../Source/C/VfrCompile/Pccts/antlr/scan.c | 20 +++++++++---------- .../Source/C/VfrCompile/Pccts/dlg/output.c | 4 ++-- .../Source/C/VfrCompile/Pccts/h/AParser.cpp | 2 +- .../Source/C/VfrCompile/Pccts/h/PCCTSAST.cpp | 4 ++-- .../C/VfrCompile/Pccts/support/genmk/genmk.c | 4 ++-- BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp | 6 +++--- .../Source/C/VfrCompile/VfrUtilityLib.cpp | 4 ++-- BaseTools/Source/C/VolInfo/VolInfo.c | 12 +++++------ 15 files changed, 60 insertions(+), 60 deletions(-) diff --git a/BaseTools/Source/C/Common/CommonLib.c b/BaseTools/Source/C/Common/CommonLib.c index 7fb4ab764f..d173de9891 100755 --- a/BaseTools/Source/C/Common/CommonLib.c +++ b/BaseTools/Source/C/Common/CommonLib.c @@ -526,8 +526,8 @@ Routine Description: } if (Uppercase) { - sprintf ( - (CHAR8 *)Buffer, + snprintf ( + (CHAR8 *)Buffer, PRINTED_GUID_BUFFER_SIZE, "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", (unsigned) Guid->Data1, Guid->Data2, @@ -542,8 +542,8 @@ Routine Description: Guid->Data4[7] ); } else { - sprintf ( - (CHAR8 *)Buffer, + snprintf ( + (CHAR8 *)Buffer, PRINTED_GUID_BUFFER_SIZE, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", (unsigned) Guid->Data1, Guid->Data2, diff --git a/BaseTools/Source/C/Common/EfiUtilityMsgs.c b/BaseTools/Source/C/Common/EfiUtilityMsgs.c index f8d2a40be1..e37cd30f55 100755 --- a/BaseTools/Source/C/Common/EfiUtilityMsgs.c +++ b/BaseTools/Source/C/Common/EfiUtilityMsgs.c @@ -459,7 +459,7 @@ Routine Description: strcpy (Line, ": "); strncat (Line, Cptr, MAX_LINE_LEN - strlen (Line) - 1); if (LineNumber != 0) { - sprintf (Line2, "(%u)", (unsigned) LineNumber); + snprintf (Line2, MAX_LINE_LEN, "(%u)", (unsigned) LineNumber); strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1); } } @@ -474,7 +474,7 @@ Routine Description: strncpy (Line, Cptr, MAX_LINE_LEN - 1); Line[MAX_LINE_LEN - 1] = 0; if (LineNumber != 0) { - sprintf (Line2, "(%u)", (unsigned) LineNumber); + snprintf (Line2, MAX_LINE_LEN, "(%u)", (unsigned) LineNumber); strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1); } } else { @@ -501,7 +501,7 @@ Routine Description: strncat (Line, ": ", MAX_LINE_LEN - strlen (Line) - 1); strncat (Line, Type, MAX_LINE_LEN - strlen (Line) - 1); if (MessageCode != 0) { - sprintf (Line2, " %04u", (unsigned) MessageCode); + snprintf (Line2, MAX_LINE_LEN, " %04u", (unsigned) MessageCode); strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1); } fprintf (stdout, "%s", Line); diff --git a/BaseTools/Source/C/Common/PcdValueCommon.c b/BaseTools/Source/C/Common/PcdValueCommon.c index 42e3581707..ba18ec3ddd 100755 --- a/BaseTools/Source/C/Common/PcdValueCommon.c +++ b/BaseTools/Source/C/Common/PcdValueCommon.c @@ -257,16 +257,16 @@ Routine Description: } break; case PcdDataTypeUint8: - sprintf(PcdList[Index].Value, "0x%02x", (UINT8)(Value & 0xff)); + snprintf(PcdList[Index].Value, 20, "0x%02x", (UINT8)(Value & 0xff)); break; case PcdDataTypeUint16: - sprintf(PcdList[Index].Value, "0x%04x", (UINT16)(Value & 0xffff)); + snprintf(PcdList[Index].Value, 20, "0x%04x", (UINT16)(Value & 0xffff)); break; case PcdDataTypeUint32: - sprintf(PcdList[Index].Value, "0x%08x", (UINT32)(Value & 0xffffffff)); + snprintf(PcdList[Index].Value, 20, "0x%08x", (UINT32)(Value & 0xffffffff)); break; case PcdDataTypeUint64: - sprintf(PcdList[Index].Value, "0x%016llx", (unsigned long long)Value); + snprintf(PcdList[Index].Value, 20, "0x%016llx", (unsigned long long)Value); break; case PcdDataTypePointer: fprintf (stderr, "PCD %s.%s.%s.%s is structure. Use PcdSetPtr()\n", SkuName, DefaultValueName, TokenSpaceGuidName, TokenName); @@ -392,7 +392,7 @@ Routine Description: PcdList[Index].Value = malloc(Size * 5 + 3); PcdList[Index].Value[0] = '{'; for (ValueIndex = 0; ValueIndex < Size; ValueIndex++) { - sprintf(&PcdList[Index].Value[1 + ValueIndex * 5], "0x%02x,", Value[ValueIndex]); + snprintf(&PcdList[Index].Value[1 + ValueIndex * 5], 20, "0x%02x,", Value[ValueIndex]); } PcdList[Index].Value[1 + Size * 5 - 1] = '}'; PcdList[Index].Value[1 + Size * 5 ] = 0; diff --git a/BaseTools/Source/C/GenFfs/GenFfs.c b/BaseTools/Source/C/GenFfs/GenFfs.c index fcb911f4fc..b4e3521483 100755 --- a/BaseTools/Source/C/GenFfs/GenFfs.c +++ b/BaseTools/Source/C/GenFfs/GenFfs.c @@ -819,13 +819,13 @@ Routine Description: goto Finish; } if (Alignment < 0x400){ - sprintf (AlignmentBuffer, "%d", Alignment); + snprintf (AlignmentBuffer, sizeof(AlignmentBuffer), "%d", Alignment); } else if (Alignment >= 0x400) { if (Alignment >= 0x100000) { - sprintf (AlignmentBuffer, "%dM", Alignment/0x100000); + snprintf (AlignmentBuffer, sizeof(AlignmentBuffer),"%dM", Alignment/0x100000); } else { - sprintf (AlignmentBuffer, "%dK", Alignment/0x400); + snprintf (AlignmentBuffer, sizeof(AlignmentBuffer), "%dK", Alignment/0x400); } } Status = StringtoAlignment (AlignmentBuffer, &(InputFileAlign[InputFileNum])); diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c index 8e41239f47..89fc86be09 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c @@ -2302,8 +2302,8 @@ TokNode *p; p->tclass->setnum = e; p->tclass->setnumErrSet = eErrSet; /* MR23 */ } - sprintf(buf, "%s_set", TokenString(p->token)); - sprintf(bufErrSet, "%s_errset", TokenString(p->token)); /* MR23 */ + snprintf(buf, sizeof(buf), "%s_set", TokenString(p->token)); + snprintf(bufErrSet, sizeof(bufErrSet), "%s_errset", TokenString(p->token)); /* MR23 */ set_name = buf; set_nameErrSet = bufErrSet; /* MR23 */ } @@ -2325,8 +2325,8 @@ TokNode *p; p->tclass->setnumComplement = e; p->tclass->setnumErrSetComplement = eErrSet; /* MR23 */ } - sprintf(buf, "%s_setbar", TokenString(p->token)); - sprintf(bufErrSet, "%s_errsetbar", TokenString(p->token)); /* MR23 */ + snprintf(buf, sizeof(buf), "%s_setbar", TokenString(p->token)); + snprintf(bufErrSet, sizeof(bufErrSet), "%s_errsetbar", TokenString(p->token)); /* MR23 */ set_name = buf; set_nameErrSet = bufErrSet; /* MR23 */ } @@ -2335,10 +2335,10 @@ TokNode *p; static char bufErrSet[sizeof("zzerr")+10]; int n = DefErrSet( &b, 0, NULL ); int nErrSet = DefErrSetWithSuffix(0, &bErrSet, 1, NULL, "_set"); - if ( GenCC ) sprintf(buf, "err%d", n); - else sprintf(buf, "zzerr%d", n); - if ( GenCC ) sprintf(bufErrSet, "err%d", nErrSet); - else sprintf(bufErrSet, "zzerr%d", nErrSet); + if ( GenCC ) snprintf(buf, sizeof(buf), "err%d", n); + else snprintf(buf, sizeof(buf), "zzerr%d", n); + if ( GenCC ) snprintf(bufErrSet, sizeof(bufErrSet), "err%d", nErrSet); + else snprintf(bufErrSet, sizeof(bufErrSet), "zzerr%d", nErrSet); set_name = buf; set_nameErrSet = bufErrSet; } @@ -4365,9 +4365,9 @@ TokNode *p; n = DefErrSet( &a, 0, NULL ); set_free(a); if ( GenCC ) - sprintf(buf, "err%d", n); + sprintf(buf, 100, "err%d", n); else - sprintf(buf, "zzerr%d", n); + sprintf(buf, 100, "zzerr%d", n); return buf; } diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c index 051ee4ec5d..4820781158 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c @@ -1241,7 +1241,7 @@ int d; { static char buf[250]; /* DANGEROUS as hell !!!!!! */ - sprintf(buf, s, d); + snprintf(buf, 250, s, d); return( buf ); } @@ -1257,7 +1257,7 @@ int d2; { static char buf[250]; /* DANGEROUS as hell !!!!!! */ - sprintf(buf, s, d1, d2); + snprintf(buf, 250, s, d1, d2); return( buf ); } @@ -1306,7 +1306,7 @@ int token; } if (1) { - sprintf(imag_name,"UnknownToken#%d",token); /* MR13 */ + sprintf(imag_name, 20, "UnknownToken#%d",token); /* MR13 */ return imag_name; /* MR13 */ } @@ -1720,7 +1720,7 @@ char *name; { static char buf[100]; char *p; - sprintf(buf, "%s", name); + snprintf(buf, 100, "%s", name); for (p=buf; *p!='\0'; p++) { @@ -1740,7 +1740,7 @@ int altnum; { static char buf[100]; char *p; - sprintf(buf, "_blk%d_alt%d", blockid, altnum); + snprintf(buf, 100, "_blk%d_alt%d", blockid, altnum); p = (char *)malloc(strlen(buf)+1); strcpy(p, buf); return p; diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c index b57f5ded84..42be0690b0 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c @@ -2215,9 +2215,9 @@ char * MR_ruleNamePlusOffset(n) strncpy(ruleNameStatic1,n->rname,ruleNameMax); if (offset < 0) { - sprintf(ruleNameStatic2,"%s/?",ruleNameStatic1); + snprintf(ruleNameStatic2, sizeof(ruleNameStatic2), "%s/?",ruleNameStatic1); } else { - sprintf(ruleNameStatic2,"%s/%d",ruleNameStatic1,offset+1); + snprintf(ruleNameStatic2, sizeof(ruleNameStatic2), "%s/%d",ruleNameStatic1,offset+1); }; return ruleNameStatic2; } diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/scan.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/scan.c index 9b4bde08e6..eaa9945a03 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/scan.c +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/scan.c @@ -1285,9 +1285,9 @@ static void act113() if ( strlen(zzbegexpr)>(size_t)85 ) fatal("$i attrib ref too big"); set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction); - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s)", + if ( !GenCC ) snprintf(buf, 100, "zzaArg(zztasp%d,%s)", BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"_t%d%s", + else snprintf(buf, 100, "_t%d%s", BlkLevel-1,zzbegexpr+1); zzreplstr(buf); zzmore(); @@ -1308,9 +1308,9 @@ static void act114() fatal("$i.field attrib ref too big"); zzbegexpr[strlen(zzbegexpr)-1] = ' '; set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction); - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s).", + if ( !GenCC ) snprintf(buf, 100, "zzaArg(zztasp%d,%s).", BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"_t%d%s.", + else snprintf(buf, 100, "_t%d%s.", BlkLevel-1,zzbegexpr+1); zzreplstr(buf); zzmore(); @@ -1344,8 +1344,8 @@ static void act115() *q++ = *p; } *q = '\0'; - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%s,%s)",i,j); - else sprintf(buf,"_t%s%s",i,j); + if ( !GenCC ) snprintf(buf, sizeof(buf), "zzaArg(zztasp%s,%s)",i,j); + else snprintf(buf, sizeof(buf), "_t%s%s",i,j); zzreplstr(buf); zzmore(); UsedOldStyleAttrib = 1; @@ -1369,7 +1369,7 @@ static void act116() if ( hasMultipleOperands( CurRetDef ) ) { require (strlen(zzbegexpr)<=(size_t)285, "$retval attrib ref too big"); - sprintf(buf,"_retv.%s",&zzbegexpr[1]); + snprintf(buf, sizeof(buf), "_retv.%s",&zzbegexpr[1]); zzreplstr(buf); } else zzreplstr("_retv"); @@ -1439,8 +1439,8 @@ static void act120() static char buf[100]; if ( strlen(zzbegexpr)>(size_t)85 ) fatal("#i AST ref too big"); - if ( GenCC ) sprintf(buf,"_ast%d%s",BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"zzastArg(%s)",zzbegexpr+1); + if ( GenCC ) snprintf(buf, sizeof(buf), "_ast%d%s",BlkLevel-1,zzbegexpr+1); + else snprintf(buf, sizeof(buf), "zzastArg(%s)",zzbegexpr+1); zzreplstr(buf); zzmore(); set_orel(atoi(zzbegexpr+1), &AST_nodes_refd_in_actions); @@ -1484,7 +1484,7 @@ static void act123() strcmp(zzbegexpr, "#error")==0) ) { static char buf[100]; - sprintf(buf, "%s_ast", zzbegexpr+1); + snprintf(buf, sizeof(buf), "%s_ast", zzbegexpr+1); /* MR27 */ list_add(&CurAstLabelsInActions, mystrdup(zzbegexpr+1)); zzreplstr(buf); chkGTFlag(); diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/output.c b/BaseTools/Source/C/VfrCompile/Pccts/dlg/output.c index 2e56a6d8c1..f2952c0236 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/output.c +++ b/BaseTools/Source/C/VfrCompile/Pccts/dlg/output.c @@ -122,7 +122,7 @@ char *name; #endif { static char buf[100]; - sprintf(buf, "%s_h", name); + snprintf(buf, sizeof(buf), "%s_h", name); return buf; } @@ -712,7 +712,7 @@ char *suffix; static char buf[200]; extern char *class_name; - sprintf(buf, "%s%s", class_name, suffix); + snprintf(buf, sizeof(buf), "%s%s", class_name, suffix); return buf; } diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp b/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp index 720fe75af1..3db482cff0 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp +++ b/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp @@ -251,7 +251,7 @@ LT(int i) if ( i >= inputTokens->bufferSize() || inputTokens->minTokens() < LLk ) /* MR20 Was "<=" */ { char buf[2000]; /* MR20 Was "static" */ - sprintf(buf, "The minimum number of tokens you requested that the\nANTLRTokenBuffer buffer is not enough to satisfy your\nLT(%d) request; increase 'k' argument to constructor for ANTLRTokenBuffer\n", i); + snprintf(buf, sizeof(buf), "The minimum number of tokens you requested that the\nANTLRTokenBuffer buffer is not enough to satisfy your\nLT(%d) request; increase 'k' argument to constructor for ANTLRTokenBuffer\n", i); panic(buf); } #endif diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.cpp b/BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.cpp index a8249cdac0..2c8b7ea404 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.cpp +++ b/BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.cpp @@ -602,7 +602,7 @@ stringparser_parse_element(StringParser *parser) p->label_num = label; return p; } - sprintf(ebuf, "mismatch token in scan(): %s", scan_token_str(parser->token)); + snprintf(ebuf, sizeof(ebuf), "mismatch token in scan(): %s", scan_token_str(parser->token)); panic(ebuf); return NULL; } @@ -659,7 +659,7 @@ stringscan_gettok(StringLexer *scanner) case '\0' : return __StringScanEOF; case __StringScanEOF : return __StringScanEOF; default : - sprintf(ebuf, "invalid char in scan: '%c'", scanner->c); + snprintf(ebuf, sizeof(ebuf), "invalid char in scan: '%c'", scanner->c); panic(ebuf); } return __StringScanEOF; // never reached diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk.c b/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk.c index 4952a30b38..f24439a880 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk.c +++ b/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk.c @@ -437,7 +437,7 @@ void help() while ( p->option!=NULL && *(p->option) != '*' ) { buf[0]='\0'; - if ( p->arg ) sprintf(buf, "%s ___", p->option); + if ( p->arg ) snprintf(buf, sizeof(buf), "%s ___", p->option); else strcpy(buf, p->option); fprintf(stderr, "\t%-16s %s\n", buf, p->descr); p++; @@ -1058,6 +1058,6 @@ char *DIR() static char buf[200+1]; if ( strcmp(outdir,TopDirectory)==0 ) return ""; - sprintf(buf, "%s%s", outdir, DirectorySymbol); + snprintf(buf, sizeof(buf), "%s%s", outdir, DirectorySymbol); return buf; } diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp index 36d3baaf10..ecd6ae4828 100755 --- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp @@ -1491,7 +1491,7 @@ CIfrRecordInfoDB::IfrRecordAdjust ( // // report error; not found // - sprintf (ErrorMsg, "Inconsistent OpCode Record list invalid QuestionId is 0x%X", QuestionId); + snprintf (ErrorMsg, sizeof(ErrorMsg), "Inconsistent OpCode Record list invalid QuestionId is 0x%X", QuestionId); gCVfrErrorHandle.PrintMsg (0, NULL, "Error", ErrorMsg); Status = VFR_RETURN_MISMATCHED; break; @@ -1543,7 +1543,7 @@ CIfrRecordInfoDB::IfrRecordAdjust ( // // not found matched question id, report error // - sprintf (ErrorMsg, "QuestionId required by Inconsistent OpCode is not found. QuestionId is 0x%X", QuestionId); + snprintf (ErrorMsg, sizeof(ErrorMsg), "QuestionId required by Inconsistent OpCode is not found. QuestionId is 0x%X", QuestionId); gCVfrErrorHandle.PrintMsg (0, NULL, "Error", ErrorMsg); Status = VFR_RETURN_MISMATCHED; break; @@ -2201,7 +2201,7 @@ CIfrRecordInfoDB::IfrCheckAddDefaultRecord ( // Generate an error for question which misses default. // MissingDefaultCount = mAllDefaultTypeCount - QuestionDefaultInfo.mDefaultNumber; - sprintf (Msg, "The question misses %d default, the question's opcode is %d", MissingDefaultCount, pOpHead->OpCode); + snprintf (Msg, sizeof(Msg), "The question misses %d default, the question's opcode is %d", MissingDefaultCount, pOpHead->OpCode); gCVfrErrorHandle.PrintMsg (pNode->mLineNo, NULL, "Error", Msg); } } diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp index 2b9b5dbb1c..1c4f1b2064 100755 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp @@ -988,7 +988,7 @@ CVfrVarDataTypeDB::Pack ( CHAR8 Msg[MAX_STRING_LEN] = {0, }; if (Action & VFR_PACK_SHOW) { - sprintf (Msg, "value of pragma pack(show) == %d", mPackAlign); + snprintf (Msg, sizeof(Msg), "value of pragma pack(show) == %d", mPackAlign); gCVfrErrorHandle.PrintMsg (LineNum, NULL, "Warning", Msg); } @@ -2457,7 +2457,7 @@ CVfrDefaultStore::BufferVarStoreAltConfigAdd ( gCVfrBufferConfig.Open (); - sprintf (NewAltCfg, "%04x", pNode->mDefaultId); + snprintf (NewAltCfg, sizeof(NewAltCfg), "%04x", pNode->mDefaultId); if ((Returnvalue = gCVfrBufferConfig.Select(VarStoreName, VarStoreGuid)) == 0) { if ((Returnvalue = gCVfrBufferConfig.Write ('a', VarStoreName, VarStoreGuid, NewAltCfg, Type, Info.mInfo.mVarOffset, Info.mVarTotalSize, Value)) != 0) { goto WriteError; diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c index ffe0b47f03..3e7319f076 100755 --- a/BaseTools/Source/C/VolInfo/VolInfo.c +++ b/BaseTools/Source/C/VolInfo/VolInfo.c @@ -1745,8 +1745,8 @@ Routine Description: Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!"); return EFI_OUT_OF_RESOURCES; } - sprintf ( - SystemCommand, + snprintf ( + SystemCommand, sizeof(SystemCommand), OPENSSL_COMMAND_FORMAT_STRING, OpenSslPath, ToolOutputFileName, @@ -1987,8 +1987,8 @@ Routine Description: Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!"); return EFI_OUT_OF_RESOURCES; } - sprintf ( - SystemCommand, + snprintf ( + SystemCommand, sizeof(SystemCommand), EXTRACT_COMMAND_FORMAT_STRING, ExtractionTool, ToolOutputFile, @@ -2269,8 +2269,8 @@ Routine Description: // // Generate the format string for fscanf // - sprintf ( - FormatString, + snprintf ( + FormatString, sizeof(FormatString), "%%%us %%%us", (unsigned) sizeof (GPtr->Guid) - 1, (unsigned) sizeof (GPtr->BaseName) - 1 From a02ed505f386459ea8f8dd031ce578dddb4c385d Mon Sep 17 00:00:00 2001 From: EFI-Desktop-Gigabayte GA-B75m_D3H - i7 3770 - RX 570 4GB <75751143+hnanoto@users.noreply.github.com> Date: Sat, 15 Jun 2024 13:09:26 -0300 Subject: [PATCH 2/8] Create SECURITY.md Signed-off-by: EFI-Desktop-Gigabayte GA-B75m_D3H - i7 3770 - RX 570 4GB <75751143+hnanoto@users.noreply.github.com> --- SECURITY.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..034e848032 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. From 972d70e3c4d83303ff698866ac985157db2fc21c Mon Sep 17 00:00:00 2001 From: EFI-Desktop-Gigabayte GA-B75m_D3H - i7 3770 - RX 570 4GB <75751143+hnanoto@users.noreply.github.com> Date: Sat, 15 Jun 2024 15:29:38 -0300 Subject: [PATCH 3/8] Create python-package-conda.yml Signed-off-by: EFI-Desktop-Gigabayte GA-B75m_D3H - i7 3770 - RX 570 4GB <75751143+hnanoto@users.noreply.github.com> --- .github/workflows/python-package-conda.yml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/python-package-conda.yml diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml new file mode 100644 index 0000000000..f3586044ab --- /dev/null +++ b/.github/workflows/python-package-conda.yml @@ -0,0 +1,34 @@ +name: Python Package using Conda + +on: [push] + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Add conda to system path + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies + run: | + conda env update --file environment.yml --name base + - name: Lint with flake8 + run: | + conda install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + conda install pytest + pytest From 4f065de3c502a3da820251b98c7a3f0b9e815465 Mon Sep 17 00:00:00 2001 From: EFI-Desktop-Gigabayte GA-B75m_D3H - i7 3770 - RX 570 4GB <75751143+hnanoto@users.noreply.github.com> Date: Sat, 15 Jun 2024 15:33:20 -0300 Subject: [PATCH 4/8] Create codeql.yml Signed-off-by: EFI-Desktop-Gigabayte GA-B75m_D3H - i7 3770 - RX 570 4GB <75751143+hnanoto@users.noreply.github.com> --- .github/workflows/codeql.yml | 103 +++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000..cad8c37d76 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,103 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + schedule: + - cron: '28 16 * * 2' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: c-cpp + build-mode: autobuild + - language: csharp + build-mode: autobuild + - language: java-kotlin + build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too. + - language: python + build-mode: none + - language: ruby + build-mode: none + - language: swift + build-mode: autobuild + # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" From 8f347f4295d9333ef654f398b8f547a5263b9a73 Mon Sep 17 00:00:00 2001 From: Slice Date: Sun, 16 Jun 2024 21:25:47 +0300 Subject: [PATCH 5/8] fix error by previous commit Signed-off-by: Slice --- .../Source/C/LzmaCompress/LzmaCompress.c | 10 +++++-- BaseTools/Source/C/Mtoc/mtoc-v921_jief.c | 4 +-- .../Source/C/VfrCompile/Pccts/antlr/gen.c | 4 +-- .../Source/C/VfrCompile/Pccts/antlr/main.c | 4 +-- .../Source/C/VfrCompile/Pccts/h/AParser.cpp | 6 ++--- .../Source/C/VfrCompile/Pccts/h/AToken.h | 6 ++--- .../Source/C/VfrCompile/Pccts/h/DLexer.h | 2 +- .../Source/C/VfrCompile/Pccts/h/dlgauto.h | 2 +- BaseTools/Source/C/VfrCompile/Pccts/h/err.h | 4 +-- .../Pccts/support/genmk/genmk_old.c | 4 +-- rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp | 26 ++++++++++++++++--- 11 files changed, 49 insertions(+), 23 deletions(-) diff --git a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c index a3607f9b20..4601b3b849 100755 --- a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c +++ b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c @@ -73,7 +73,10 @@ int PrintError(char *buffer, const char *message) int PrintErrorNumber(char *buffer, SRes val) { - sprintf(buffer + strlen(buffer), "\nError code: %x\n", (unsigned)val); + char text[100]; + snprintf(text, 100, "\nError code: %x\n", (unsigned)val); +// sprintf(buffer + strlen(buffer), "\nError code: %x\n", (unsigned)val); + strcat(buffer, text); return 1; } @@ -84,7 +87,10 @@ int PrintUserError(char *buffer) void PrintVersion(char *buffer) { - sprintf (buffer, "%s Version %d.%d %s ", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION); +// sprintf (buffer, "%s Version %d.%d %s ", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION); + char text[500]; + snprintf(text, 500, "%s Version %d.%d %s ", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION); + strcat(buffer, text); } static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize) diff --git a/BaseTools/Source/C/Mtoc/mtoc-v921_jief.c b/BaseTools/Source/C/Mtoc/mtoc-v921_jief.c index fd74330ac4..e43c1a1aa3 100644 --- a/BaseTools/Source/C/Mtoc/mtoc-v921_jief.c +++ b/BaseTools/Source/C/Mtoc/mtoc-v921_jief.c @@ -887,7 +887,7 @@ struct arch *arch) IMAGE_SCN_MEM_WRITE | IMAGE_SCN_CNT_INITIALIZED_DATA; if(strcmp(s->sectname, "__pointers") == 0){ - sprintf(scnhdrs[j].s_name, "/%d", strsize); + snprintf(scnhdrs[j].s_name, 10, "/%d", strsize); strcat(section_name, ".pointers"); len = strlen(section_name) + 1; strsize += len; @@ -1208,7 +1208,7 @@ struct arch *arch) s64 = (struct section_64 *) ((char *)sg64 + sizeof(struct segment_command_64)); for(i = 0; i < sg64->nsects; i++, s64++){ - sprintf(scnhdrs[j].s_name, "/%d", strsize); + snprintf(scnhdrs[j].s_name, 10, "/%d", strsize); strcat(section_name, "LC_SEGMENT."); strcat(section_name, s64->segname); strcat(section_name, "."); diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c index 89fc86be09..71e0868deb 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c @@ -4365,9 +4365,9 @@ TokNode *p; n = DefErrSet( &a, 0, NULL ); set_free(a); if ( GenCC ) - sprintf(buf, 100, "err%d", n); + snprintf(buf, 100, "err%d", n); else - sprintf(buf, 100, "zzerr%d", n); + snprintf(buf, 100, "zzerr%d", n); return buf; } diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c index 4820781158..41aeb27f6f 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c @@ -1225,7 +1225,7 @@ char *a3; { static char buf[250]; /* DANGEROUS as hell !!!!!! */ - sprintf(buf, s, a1, a2, a3); + snprintf(buf, 250, s, a1, a2, a3); return( buf ); } @@ -1306,7 +1306,7 @@ int token; } if (1) { - sprintf(imag_name, 20, "UnknownToken#%d",token); /* MR13 */ + snprintf(imag_name, 20, "UnknownToken#%d",token); /* MR13 */ return imag_name; /* MR13 */ } diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp b/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp index 3db482cff0..bef6e2e155 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp +++ b/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp @@ -650,21 +650,21 @@ _setmatch_wdfltsig(SetWordType *tokensWanted, char *ANTLRParser:: eMsgd(char *err,int d) { - sprintf(eMsgBuffer, err, d); // dangerous, but I don't care + snprintf(eMsgBuffer, 500, err, d); // dangerous, but I don't care return eMsgBuffer; } char *ANTLRParser:: eMsg(char *err, char *s) { - sprintf(eMsgBuffer, err, s); + snprintf(eMsgBuffer, 500, err, s); return eMsgBuffer; } char *ANTLRParser:: eMsg2(char *err,char *s, char *t) { - sprintf(eMsgBuffer, err, s, t); + snprintf(eMsgBuffer, 500, err, s, t); return eMsgBuffer; } diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h b/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h index 6167c21ef5..c990c7c5f4 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h +++ b/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h @@ -132,8 +132,8 @@ class ANTLRRefCountToken : public ANTLRAbstractToken { { ctor++; refcnt_ = 0; - if ( t==1 ) sprintf(object,"tok_EOF"); - else sprintf(object,"tok_%s",s); + if ( t==1 ) snprintf(object, sizeof(object), "tok_EOF"); + else snprintf(object, sizeof(object), "tok_%s",s); /* MR23 */ printMessage(stderr, "ctor %s #%d\n",object,ctor); } #endif @@ -144,7 +144,7 @@ class ANTLRRefCountToken : public ANTLRAbstractToken { { ctor++; refcnt_ = 0; - sprintf(object,"tok_blank"); + snprintf(object, sizeof(object), "tok_blank"); /* MR23 */ printMessage(stderr, "ctor %s #%d\n",object,ctor); } virtual ~ANTLRRefCountToken() diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h b/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h index f15bff1187..57e73e6ec5 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h +++ b/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h @@ -57,7 +57,7 @@ mode( int m ) /* have to redo class since using different compression */ cl = ZZSHIFT(ch); }else{ - sprintf((char *)ebuf,"Invalid automaton mode = %d ",m); + snprintf((char *)ebuf, 70, "Invalid automaton mode = %d ",m); errstd(ebuf); } } diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/dlgauto.h b/BaseTools/Source/C/VfrCompile/Pccts/h/dlgauto.h index db94cefaca..80fa7e3e05 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/h/dlgauto.h +++ b/BaseTools/Source/C/VfrCompile/Pccts/h/dlgauto.h @@ -264,7 +264,7 @@ int m; /* have to redo class since using different compression */ zzclass = ZZSHIFT(zzchar); }else{ - sprintf(zzebuf,"Invalid automaton mode = %d ",m); + snprintf(zzebuf, 70, "Invalid automaton mode = %d ",m); zzerr(zzebuf); } } diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/err.h b/BaseTools/Source/C/VfrCompile/Pccts/h/err.h index 435d48356d..0ab1feeef7 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/h/err.h +++ b/BaseTools/Source/C/VfrCompile/Pccts/h/err.h @@ -929,7 +929,7 @@ int m; #endif { if(zzmdep == ZZMAXSTK - 1) { - sprintf(zzmbuf, "Mode stack overflow "); + snprintf(zzmbuf, 70, "Mode stack overflow "); zzerr(zzmbuf); } else { zzmstk[zzmdep++] = zzauto; @@ -945,7 +945,7 @@ zzmpop( ) #endif { if(zzmdep == 0) - { sprintf(zzmbuf, "Mode stack underflow "); + { snprintf(zzmbuf, 70, "Mode stack underflow "); zzerr(zzmbuf); } else diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk_old.c b/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk_old.c index 2cf9fad727..d9ac620089 100755 --- a/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk_old.c +++ b/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk_old.c @@ -307,7 +307,7 @@ void help() while ( p->option!=NULL && *(p->option) != '*' ) { buf[0]='\0'; - if ( p->arg ) sprintf(buf, "%s ___", p->option); + if ( p->arg ) spnrintf(buf, 1001, "%s ___", p->option); else strcpy(buf, p->option); fprintf(stderr, "\t%-16s %s\n", buf, p->descr); p++; @@ -757,6 +757,6 @@ char *DIR() static char buf[200+1]; if ( strcmp(outdir,TopDirectory)==0 ) return ""; - sprintf(buf, "%s%s", outdir, DirectorySymbol); + snprintf(buf, 201, "%s%s", outdir, DirectorySymbol); return buf; } diff --git a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp index c773578e88..51ade1fbfc 100644 --- a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp +++ b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp @@ -75,6 +75,27 @@ #include "../Platform/Settings.h" #include "../Platform/StartupSound.h" // for audioIo +///0C483552-CAC3-4E72-B7DD-94F16C44C394 +constexpr const EFI_GUID PreGuid = { 0x0C483552, 0xCAC3, 0x4E72, { 0x87, 0xDD, 0x94, 0xF1, 0x6C, 0x44, 0xC3, 0x94 } }; +void testEfires() +{ +// EFI_STATUS Status; +// UINTN HandleCount = 0; +// EFI_HANDLE *Handles; +// EFI_FILE* dir; + + +// Status = gBS->LocateHandleBuffer(ByProtocol, &PreGuid, NULL, &HandleCount, &Handles); +// if (!EFI_ERROR(Status) && HandleCount > 0) { +// dir = EfiLibOpenRoot(Handles[0]); +// if (dir == NULL) +// Status = EFI_NOT_FOUND; +// FreePool(Handles); +// } + + +} + // const CHAR16 ArrowUp[2] = { ARROW_UP, 0 }; //defined in Simple Text Out protocol const CHAR16 ArrowDown[2] = { ARROW_DOWN, 0 }; @@ -1000,9 +1021,8 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI break; case SCAN_F8: // testSVG(); - testBMP(); -// SaveHdaDumpBin(); -// SaveHdaDumpTxt(); + // testBMP(); + testEfires(); break; case SCAN_F9: From 2593b69c67d25a08cd8720180e99844d98d9cda4 Mon Sep 17 00:00:00 2001 From: Slice Date: Tue, 18 Jun 2024 22:37:56 +0300 Subject: [PATCH 6/8] exclude double protocol Signed-off-by: Slice --- rEFIt_UEFI/Platform/Injectors.cpp | 24 ++++++------ rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp | 2 +- rEFIt_UEFI/libeg/AppleImageCodec.cpp | 56 ++++++++++++++-------------- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/rEFIt_UEFI/Platform/Injectors.cpp b/rEFIt_UEFI/Platform/Injectors.cpp index a808e6f1ed..0312e9ac7b 100644 --- a/rEFIt_UEFI/Platform/Injectors.cpp +++ b/rEFIt_UEFI/Platform/Injectors.cpp @@ -419,23 +419,25 @@ SetPrivateVarProto(void) &SMCHelperProtocol, &gAppleSMCStateProtocolGuid, &SMCStateProtocol, + &gAppleImageCodecProtocolGuid, + &gAppleImageCodec, NULL ); if (EFI_ERROR(Status)) { DBG("Error installing multiple protocol, Status = %s\n", efiStrError(Status)); } - - Status = gBS->InstallProtocolInterface ( - &gImageHandle, - &gAppleImageCodecProtocolGuid, - EFI_NATIVE_INTERFACE, - (VOID *)&gAppleImageCodec - ); - - if (EFI_ERROR(Status)) { - DBG("AppleImageCodec: error installing protocol, Status = %s\n", efiStrError(Status)); - } +// +// Status = gBS->InstallProtocolInterface ( +// &gImageHandle, +// &gAppleImageCodecProtocolGuid, +// EFI_NATIVE_INTERFACE, +// (VOID *)&gAppleImageCodec +// ); +// +// if (EFI_ERROR(Status)) { +// DBG("AppleImageCodec: error installing protocol, Status = %s\n", efiStrError(Status)); +// } Status = InstallAggregator(); if (EFI_ERROR(Status)) { diff --git a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp index 51ade1fbfc..940a9044a3 100644 --- a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp +++ b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp @@ -1021,7 +1021,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI break; case SCAN_F8: // testSVG(); - // testBMP(); + testBMP(); testEfires(); break; diff --git a/rEFIt_UEFI/libeg/AppleImageCodec.cpp b/rEFIt_UEFI/libeg/AppleImageCodec.cpp index 3cb4eae5da..757d9f6340 100644 --- a/rEFIt_UEFI/libeg/AppleImageCodec.cpp +++ b/rEFIt_UEFI/libeg/AppleImageCodec.cpp @@ -210,31 +210,31 @@ APPLE_IMAGE_CODEC_PROTOCOL gAppleImageCodec = { }; /** Driver's entry point. Installs our StartImage to detect boot loader start. */ -EFI_STATUS -EFIAPI -AppleImageCodecEntrypoint ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable -) -{ - EFI_STATUS Status; -// EFI_HANDLE NewHandle; - - // - // Install instance of Apple image codec protocol for - // PNG files - // -// NewHandle = NULL; // install to a new handle -// Status = gBS->InstallMultipleProtocolInterfaces(&NewHandle, &gAppleImageCodecProtocolGuid, &gAppleImageCodec, NULL); - Status = gBS->InstallProtocolInterface ( - &ImageHandle, - &gAppleImageCodecProtocolGuid, - EFI_NATIVE_INTERFACE, - (VOID *)&gAppleImageCodec - ); - - if (EFI_ERROR(Status)) { - DBG("AppleImageCodec: error installing protocol, Status = %s\n", efiStrError(Status)); - } - return Status; -} +//EFI_STATUS +//EFIAPI +//AppleImageCodecEntrypoint ( +// IN EFI_HANDLE ImageHandle, +// IN EFI_SYSTEM_TABLE *SystemTable +//) +//{ +// EFI_STATUS Status; +//// EFI_HANDLE NewHandle; +// +// // +// // Install instance of Apple image codec protocol for +// // PNG files +// // +//// NewHandle = NULL; // install to a new handle +//// Status = gBS->InstallMultipleProtocolInterfaces(&NewHandle, &gAppleImageCodecProtocolGuid, &gAppleImageCodec, NULL); +// Status = gBS->InstallProtocolInterface ( +// &ImageHandle, +// &gAppleImageCodecProtocolGuid, +// EFI_NATIVE_INTERFACE, +// (VOID *)&gAppleImageCodec +// ); +// +// if (EFI_ERROR(Status)) { +// DBG("AppleImageCodec: error installing protocol, Status = %s\n", efiStrError(Status)); +// } +// return Status; +//} From d8faea0ed84dcba15e7d52d91b4e3d2ea97586a3 Mon Sep 17 00:00:00 2001 From: Slice Date: Fri, 21 Jun 2024 23:20:19 +0300 Subject: [PATCH 7/8] exclude unused variable Signed-off-by: Slice --- rEFIt_UEFI/Platform/Injectors.cpp | 3 ++- rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rEFIt_UEFI/Platform/Injectors.cpp b/rEFIt_UEFI/Platform/Injectors.cpp index 0312e9ac7b..4a79d3e386 100644 --- a/rEFIt_UEFI/Platform/Injectors.cpp +++ b/rEFIt_UEFI/Platform/Injectors.cpp @@ -402,7 +402,8 @@ SetPrivateVarProto(void) EFI_STATUS Status; //This must be independent install // optional protocols - Status = gBS->InstallMultipleProtocolInterfaces (&gImageHandle, + EFI_HANDLE NewHandle = NULL; + Status = gBS->InstallMultipleProtocolInterfaces ( &NewHandle,///&gImageHandle, &gAppleFramebufferInfoProtocolGuid, &mScreenInfo, // &gEfiOSInfoProtocolGuid, diff --git a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp index 940a9044a3..8b2268c1c8 100644 --- a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp +++ b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp @@ -76,7 +76,7 @@ #include "../Platform/StartupSound.h" // for audioIo ///0C483552-CAC3-4E72-B7DD-94F16C44C394 -constexpr const EFI_GUID PreGuid = { 0x0C483552, 0xCAC3, 0x4E72, { 0x87, 0xDD, 0x94, 0xF1, 0x6C, 0x44, 0xC3, 0x94 } }; +//constexpr const EFI_GUID PreGuid = { 0x0C483552, 0xCAC3, 0x4E72, { 0x87, 0xDD, 0x94, 0xF1, 0x6C, 0x44, 0xC3, 0x94 } }; void testEfires() { // EFI_STATUS Status; From 43ac33a1d491f0d59edf42f11d01a02c2e856905 Mon Sep 17 00:00:00 2001 From: Slice Date: Tue, 25 Jun 2024 19:23:32 +0300 Subject: [PATCH 8/8] added sequoia svg image Signed-off-by: Slice --- .../CloverV2/themespkg/cesium/theme.svg | 131 +++++++++++++++++- 1 file changed, 126 insertions(+), 5 deletions(-) diff --git a/CloverPackage/CloverV2/themespkg/cesium/theme.svg b/CloverPackage/CloverV2/themespkg/cesium/theme.svg index 5bccc5eabb..76db460ce8 100644 --- a/CloverPackage/CloverV2/themespkg/cesium/theme.svg +++ b/CloverPackage/CloverV2/themespkg/cesium/theme.svg @@ -18,7 +18,7 @@ BadgeScale="0x08" CharWidth="14" VerticalLayout="1" -Version="0.23" +Version="0.24" Year="2018" Author="Slice, Nikary, AlienLiaru" Description="metallic vector theme for Clover" @@ -2729,6 +2729,14 @@ Created="December 2018"/> offset="1" /> + + + @@ -3618,12 +3638,13 @@ d="M503 939l-34 -741q0 -1 -3 -1h-88q-3 0 -3 1l-37 741l-6 664q0 1 3 1h170q3 0 3 - id="stop896" /> - + - + + + + + + + + + + + + + + + + + + + + + + Sequoia + + +