зеркало из https://github.com/microsoft/mu_plus.git
Merged PR 6022: CodeQL Fixes
## Description Resolves CodeQL issues. Another lighter pass of CodeQL will occur shortly in the future. - [ ] Breaking change? - Will this change break pre-existing builds or functionality without action being taken? **No** ## How This Was Tested - Verified CI build - Checked before and after CodeQL results - Verified boot on QemuQ35Pkg ## Integration Instructions N/A - If CodeQL was run before these changes, run again to get latest results Co-authored-by: Ken Lautner <klautner@microsoft.com> Co-authored-by: Mike Turner <miketur@microsoft.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
This commit is contained in:
Родитель
21af9a5044
Коммит
379bd43e71
|
@ -158,7 +158,7 @@ EFI_STATUS
|
|||
EFIAPI
|
||||
AdvancedLoggerAccessLibUnitTestInitialize (
|
||||
IN ADVANCED_LOGGER_PROTOCOL *TestProtocol OPTIONAL,
|
||||
IN UINTN MaxMessageSize
|
||||
IN UINT16 MaxMessageSize
|
||||
);
|
||||
|
||||
#endif // __ADVANCED_LOGGER_ACCESS_LIB_H__
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
STATIC ADVANCED_LOGGER_INFO *mLoggerInfo = NULL;
|
||||
STATIC ADVANCED_LOGGER_MESSAGE_ENTRY *mLowAddress = NULL;
|
||||
STATIC ADVANCED_LOGGER_MESSAGE_ENTRY *mHighAddress = NULL;
|
||||
STATIC UINTN mMaxMessageSize = ADVANCED_LOGGER_MAX_MESSAGE_SIZE;
|
||||
STATIC UINT16 mMaxMessageSize = ADVANCED_LOGGER_MAX_MESSAGE_SIZE;
|
||||
|
||||
#define ADV_TIME_STAMP_FORMAT "%2.2d:%2.2d:%2.2d.%3.3d : "
|
||||
#define ADV_TIME_STAMP_RESULT "hh:mm:ss:ttt : "
|
||||
|
@ -315,7 +315,7 @@ EFI_STATUS
|
|||
EFIAPI
|
||||
AdvancedLoggerAccessLibUnitTestInitialize (
|
||||
IN ADVANCED_LOGGER_PROTOCOL *TestProtocol OPTIONAL,
|
||||
IN UINTN MaxMessageSize
|
||||
IN UINT16 MaxMessageSize
|
||||
)
|
||||
{
|
||||
ADVANCED_LOGGER_PROTOCOL *LoggerProtocol = NULL;
|
||||
|
|
|
@ -21,7 +21,7 @@ def set_delimiter (new_delimiter):
|
|||
global delimiter
|
||||
delimiter = new_delimiter
|
||||
|
||||
def AddSection (outFile, sectionName, sectionFileName):
|
||||
def add_section(outFile, sectionName, sectionFileName):
|
||||
|
||||
|
||||
if (not sectionFileName):
|
||||
|
@ -72,14 +72,14 @@ def main():
|
|||
outFile = open (options.OutputFilePath, "w")
|
||||
|
||||
set_delimiter ('{')
|
||||
AddSection (outFile, 'ProvisioningPacket', options.IdFilePath)
|
||||
AddSection (outFile, 'ProvisioningPacket2', options.Id2FilePath)
|
||||
AddSection (outFile, 'PermissionsPacket', options.PermFilePath)
|
||||
AddSection (outFile, 'PermissionsPacket2', options.Perm2FilePath)
|
||||
AddSection (outFile, 'TransitionPacket1', options.Transition1FilePath)
|
||||
AddSection (outFile, 'TransitionPacket2', options.Transition2FilePath)
|
||||
AddSection (outFile, 'SettingsPacket', options.SettingsFilePath)
|
||||
AddSection (outFile, 'SettingsPacket2', options.Settings2FilePath)
|
||||
add_section(outFile, 'ProvisioningPacket', options.IdFilePath)
|
||||
add_section(outFile, 'ProvisioningPacket2', options.Id2FilePath)
|
||||
add_section(outFile, 'PermissionsPacket', options.PermFilePath)
|
||||
add_section(outFile, 'PermissionsPacket2', options.Perm2FilePath)
|
||||
add_section(outFile, 'TransitionPacket1', options.Transition1FilePath)
|
||||
add_section(outFile, 'TransitionPacket2', options.Transition2FilePath)
|
||||
add_section(outFile, 'SettingsPacket', options.SettingsFilePath)
|
||||
add_section(outFile, 'SettingsPacket2', options.Settings2FilePath)
|
||||
|
||||
if (delimiter == '{'):
|
||||
raise exception ("No package written")
|
||||
|
|
|
@ -72,7 +72,7 @@ PeimInitializeGuidedSectionExtract (
|
|||
//
|
||||
// Install custom extraction guid PPI
|
||||
//
|
||||
if (ExtractHandlerNumber > 0) {
|
||||
if ((ExtractHandlerNumber > 0) && (ExtractHandlerGuidTable != NULL)) {
|
||||
GuidPpi = (EFI_PEI_PPI_DESCRIPTOR *)AllocatePool (ExtractHandlerNumber * sizeof (EFI_PEI_PPI_DESCRIPTOR));
|
||||
ASSERT (GuidPpi != NULL);
|
||||
while (ExtractHandlerNumber-- > 0) {
|
||||
|
|
|
@ -154,7 +154,7 @@ UpdateGopDevicePath (
|
|||
FreePool (Instance);
|
||||
} while (DevicePath != NULL);
|
||||
|
||||
if (!Exist) {
|
||||
if ((!Exist) && (Return != NULL)) {
|
||||
Temp = Return;
|
||||
Return = AppendDevicePathInstance (Return, Gop);
|
||||
if (Temp != NULL) {
|
||||
|
@ -216,15 +216,17 @@ PlatformBootManagerBeforeConsole (
|
|||
}
|
||||
|
||||
FreePool (TempDevicePath);
|
||||
Status = gRT->SetVariable (
|
||||
L"ConOut",
|
||||
&gEfiGlobalVariableGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
GetDevicePathSize (ConsoleOut),
|
||||
ConsoleOut
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: Error setting ConOut. Code = %r\n", __FUNCTION__, Status));
|
||||
if (ConsoleOut != NULL) {
|
||||
Status = gRT->SetVariable (
|
||||
L"ConOut",
|
||||
&gEfiGlobalVariableGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
GetDevicePathSize (ConsoleOut),
|
||||
ConsoleOut
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: Error setting ConOut. Code = %r\n", __FUNCTION__, Status));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -264,8 +264,8 @@ DrawAll (
|
|||
|
||||
Pix = ((UINT32 *)thispri->PublicPC.FrameBufferBase) + (thispri->UpperLeft.Y * thispri->PublicPC.PixelsPerScanLine) + thispri->UpperLeft.X;
|
||||
cur = (UINT8 *)thispri->BitmapData;
|
||||
for (UINT16 Y = 0; Y < thispri->BmpWidth; Y++) {
|
||||
for (UINT16 X = 0; X < thispri->BmpWidth; X++) {
|
||||
for (INTN Y = 0; Y < thispri->BmpWidth; Y++) {
|
||||
for (INTN X = 0; X < thispri->BmpWidth; X++) {
|
||||
if (*cur != OUTSIDE_CONTROL) {
|
||||
*(Pix + X) = Color;
|
||||
}
|
||||
|
@ -317,10 +317,10 @@ DrawSegment (
|
|||
cur = (UINT8 *)thispri->BitmapData;
|
||||
|
||||
// iterate each line looking for requested segment
|
||||
for (UINT16 Y = 0; Y < thispri->BmpWidth; Y++) {
|
||||
for (INTN Y = 0; Y < thispri->BmpWidth; Y++) {
|
||||
FoundInThisRow = FALSE; // reset for next row
|
||||
|
||||
for (UINT16 X = 0; X < thispri->BmpWidth; X++) {
|
||||
for (INTN X = 0; X < thispri->BmpWidth; X++) {
|
||||
if (*cur == Segment) {
|
||||
*(Pix + X) = Color;
|
||||
FoundInThisRow = TRUE;
|
||||
|
@ -356,11 +356,11 @@ Fill (
|
|||
)
|
||||
{
|
||||
// go line by line vertically
|
||||
for (UINT16 Y = 0; Y < this->BmpWidth; Y++) {
|
||||
for (INTN Y = 0; Y < this->BmpWidth; Y++) {
|
||||
UINT8 *start = NULL;
|
||||
UINT8 *cur = this->BitmapData + (Y * this->BmpWidth);
|
||||
// go across a line horizontally starting on the left side
|
||||
for (UINT16 X = 0; X < this->BmpWidth; X++) {
|
||||
for (INTN X = 0; X < this->BmpWidth; X++) {
|
||||
// find outer edge
|
||||
if (*cur == OUTER_RADIUS) {
|
||||
// find the left side
|
||||
|
@ -453,8 +453,8 @@ Segmatize (
|
|||
{
|
||||
UINT8 *cur = this->BitmapData;
|
||||
|
||||
for (UINT16 Y = 0; Y < this->BmpWidth; Y++) {
|
||||
for (UINT16 X = 0; X < this->BmpWidth; X++) {
|
||||
for (INTN Y = 0; Y < this->BmpWidth; Y++) {
|
||||
for (INTN X = 0; X < this->BmpWidth; X++) {
|
||||
if (*cur != OUTSIDE_CONTROL) {
|
||||
POINT t;
|
||||
t.X = X;
|
||||
|
|
|
@ -280,8 +280,11 @@ DisplayDeviceState (
|
|||
}
|
||||
|
||||
UI_RECTANGLE *rect = new_UI_RECTANGLE (&ul, FrameBufferBase, PixelsPerScanLine, (UINT16)WidthInPixels, SingleBannerHeight, &si);
|
||||
DrawRect (rect);
|
||||
delete_UI_RECTANGLE (rect);
|
||||
if (rect != NULL) {
|
||||
DrawRect (rect);
|
||||
delete_UI_RECTANGLE (rect);
|
||||
}
|
||||
|
||||
ul.Y += SingleBannerHeight;
|
||||
Notifications -= *SupportedNotification; // subtract notification so that we can break early.
|
||||
} // close if notification is supported
|
||||
|
|
|
@ -365,7 +365,8 @@ Ctor (
|
|||
IN VOID *pSelectionContext
|
||||
)
|
||||
{
|
||||
UINT32 MaxGlyphDescent;
|
||||
UINT32 MaxGlyphDescent;
|
||||
EFI_STATUS Status;
|
||||
|
||||
// Initialize variables.
|
||||
//
|
||||
|
@ -406,16 +407,20 @@ Ctor (
|
|||
//
|
||||
CopyMem (&this->m_pButton->ButtonTextBounds, &ButtonBox, sizeof (SWM_RECT));
|
||||
|
||||
GetTextStringBitmapSize (
|
||||
pButtonText,
|
||||
FontInfo,
|
||||
TRUE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&this->m_pButton->ButtonTextBounds,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
pButtonText,
|
||||
FontInfo,
|
||||
TRUE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&this->m_pButton->ButtonTextBounds,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
UINT32 ButtonWidth = (this->m_pButton->ButtonBounds.Right - this->m_pButton->ButtonBounds.Left + 1);
|
||||
UINT32 ButtonHeight = (this->m_pButton->ButtonBounds.Bottom - this->m_pButton->ButtonBounds.Top + 1);
|
||||
|
@ -499,8 +504,9 @@ new_Button (
|
|||
IN VOID *pSelectionContext
|
||||
)
|
||||
{
|
||||
SWM_RECT Rect, TempRect;
|
||||
UINT32 MaxGlyphDescent;
|
||||
SWM_RECT Rect, TempRect;
|
||||
UINT32 MaxGlyphDescent;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Button *B = (Button *)AllocateZeroPool (sizeof (Button));
|
||||
|
||||
|
@ -525,16 +531,21 @@ new_Button (
|
|||
if ((ButtonWidth == SUI_BUTTON_AUTO_SIZE) || (ButtonHeight == SUI_BUTTON_AUTO_SIZE)) {
|
||||
// Yes, this is wasteful and redundant.
|
||||
// Don't care.
|
||||
GetTextStringBitmapSize (
|
||||
pButtonText,
|
||||
FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&TempRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
pButtonText,
|
||||
FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&TempRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
FreePool (B);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Rect.Right = Rect.Left + (TempRect.Right - TempRect.Left) + SUI_BUTTON_HIGHLIGHT_X_PAD; // Add px to allow space for the "Tab highlight".
|
||||
Rect.Bottom = Rect.Top + (TempRect.Bottom - TempRect.Top) + SUI_BUTTON_HIGHLIGHT_Y_PAD; // Add px to allow space for the "Tab highlight".
|
||||
|
|
|
@ -627,16 +627,20 @@ Ctor (
|
|||
SetMem16 (this->m_EditBoxText, (MaxDisplayChars * sizeof (CHAR16)), L'W');
|
||||
this->m_EditBoxText[MaxDisplayChars] = L'\0';
|
||||
|
||||
GetTextStringBitmapSize (
|
||||
this->m_EditBoxText,
|
||||
pFontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&TextRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
this->m_EditBoxText,
|
||||
pFontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&TextRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->m_EditBoxText[0] = L'\0';
|
||||
|
||||
|
|
|
@ -464,16 +464,20 @@ RenderToggleSwitch (
|
|||
// TODO - bounds should apply to the toggle switch and it's text, combined.
|
||||
//
|
||||
CopyMem (&StringRect, &this->m_pToggleSwitch->ToggleSwitchBounds, sizeof (SWM_RECT));
|
||||
GetTextStringBitmapSize (
|
||||
pString,
|
||||
&StringInfo->FontInfo,
|
||||
TRUE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
pString,
|
||||
&StringInfo->FontInfo,
|
||||
TRUE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
SWM_RECT *pRect = &this->m_pToggleSwitch->ToggleSwitchBounds;
|
||||
UINTN SwitchOrigY = (pRect->Top + ((pRect->Bottom - pRect->Top + 1) / 2) - ((StringRect.Bottom - StringRect.Top + 1) / 2));
|
||||
|
|
|
@ -104,19 +104,19 @@ GetTextStringBitmapSize (
|
|||
StringRowInfo = (EFI_HII_ROW_INFO *)NULL;
|
||||
RowInfoSize = 0;
|
||||
|
||||
mUITSWM->StringToWindow (
|
||||
mUITSWM,
|
||||
mClientImageHandle,
|
||||
HiiFlags,
|
||||
xString,
|
||||
StringInfo,
|
||||
&BltBuffer,
|
||||
0,
|
||||
0,
|
||||
&StringRowInfo,
|
||||
&RowInfoSize,
|
||||
(UINTN *)NULL
|
||||
);
|
||||
Status = mUITSWM->StringToWindow (
|
||||
mUITSWM,
|
||||
mClientImageHandle,
|
||||
HiiFlags,
|
||||
xString,
|
||||
StringInfo,
|
||||
&BltBuffer,
|
||||
0,
|
||||
0,
|
||||
&StringRowInfo,
|
||||
&RowInfoSize,
|
||||
(UINTN *)NULL
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "ERROR [SUIT]: Failed to calculate string bitmap size: %r.\n", Status));
|
||||
|
@ -346,9 +346,11 @@ DupFontInfo (
|
|||
|
||||
NewFontInfo = AllocatePool (sizeof (EFI_FONT_INFO) + FontNameSize);
|
||||
|
||||
CopyMem (NewFontInfo, FontInfo, sizeof (EFI_FONT_INFO) + FontNameSize);
|
||||
if (FontNameSize <= sizeof (FontInfo->FontName[0])) {
|
||||
NewFontInfo->FontName[0] = '\0';
|
||||
if (NewFontInfo != NULL) {
|
||||
CopyMem (NewFontInfo, FontInfo, sizeof (EFI_FONT_INFO) + FontNameSize);
|
||||
if (FontNameSize <= sizeof (FontInfo->FontName[0])) {
|
||||
NewFontInfo->FontName[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
return NewFontInfo;
|
||||
|
|
|
@ -261,16 +261,20 @@ CreateDialogControls (
|
|||
|
||||
// Calculate the string bitmap size of the largest button text.
|
||||
//
|
||||
GetTextStringBitmapSize (
|
||||
LongestButtonText,
|
||||
&FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
LongestButtonText,
|
||||
&FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
// Calculate the size and shape of the buttons.
|
||||
//
|
||||
|
@ -542,16 +546,20 @@ DrawDialogFrame (
|
|||
UINT32 MaxDescent;
|
||||
SWM_RECT StringRect;
|
||||
|
||||
GetTextStringBitmapSize (
|
||||
pTitleBarText,
|
||||
&StringInfo.FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
pTitleBarText,
|
||||
&StringInfo.FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
// Render the string to the screen, vertically centered.
|
||||
//
|
||||
|
|
|
@ -440,16 +440,20 @@ CreateDialogControls (
|
|||
|
||||
// Calculate the string bitmap size of the largest button text.
|
||||
//
|
||||
GetTextStringBitmapSize (
|
||||
SWM_PWD_OK_TEXT_STRING,
|
||||
&FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
SWM_PWD_OK_TEXT_STRING,
|
||||
&FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
// Calculate the position and size of the first button.
|
||||
//
|
||||
|
@ -693,16 +697,20 @@ DrawDialogFrame (
|
|||
UINT32 MaxDescent;
|
||||
SWM_RECT StringRect;
|
||||
|
||||
GetTextStringBitmapSize (
|
||||
pTitleBarText,
|
||||
&StringInfo.FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
pTitleBarText,
|
||||
&StringInfo.FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
// Render the string to the screen, vertically centered.
|
||||
//
|
||||
|
|
|
@ -544,16 +544,20 @@ CreateDialogControls (
|
|||
|
||||
// Calculate the string bitmap size of the largest button text.
|
||||
//
|
||||
GetTextStringBitmapSize (
|
||||
SWM_PWD_OK_TEXT_STRING,
|
||||
&FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
SWM_PWD_OK_TEXT_STRING,
|
||||
&FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
// Calculate the position and size of the first button.
|
||||
//
|
||||
|
@ -787,16 +791,20 @@ DrawDialogFrame (
|
|||
UINT32 MaxDescent;
|
||||
SWM_RECT StringRect;
|
||||
|
||||
GetTextStringBitmapSize (
|
||||
pTitleBarText,
|
||||
&StringInfo.FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
pTitleBarText,
|
||||
&StringInfo.FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
// Render the string to the screen, vertically centered.
|
||||
//
|
||||
|
|
|
@ -221,16 +221,20 @@ CreateDialogControls (
|
|||
OptionCells[Index].CellText = Options[Index];
|
||||
// Calculate the string bitmap size of the of this item.
|
||||
//
|
||||
GetTextStringBitmapSize (
|
||||
Options[Index],
|
||||
&FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
Options[Index],
|
||||
&FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
TempCellWidth = (StringRect.Right - StringRect.Left + 1);
|
||||
if (TempCellWidth > MaxCellWidth) {
|
||||
|
@ -306,16 +310,20 @@ CreateDialogControls (
|
|||
|
||||
// Calculate the string bitmap size of the largest button text.
|
||||
//
|
||||
GetTextStringBitmapSize (
|
||||
SWM_SS_OK_TEXT_STRING,
|
||||
&FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
SWM_SS_OK_TEXT_STRING,
|
||||
&FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxGlyphDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
// Calculate the position and size of the first button.
|
||||
//
|
||||
|
@ -546,16 +554,20 @@ DrawDialogFrame (
|
|||
UINT32 MaxDescent;
|
||||
SWM_RECT StringRect;
|
||||
|
||||
GetTextStringBitmapSize (
|
||||
pTitleBarText,
|
||||
&StringInfo.FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxDescent
|
||||
);
|
||||
Status = GetTextStringBitmapSize (
|
||||
pTitleBarText,
|
||||
&StringInfo.FontInfo,
|
||||
FALSE,
|
||||
EFI_HII_OUT_FLAG_CLIP |
|
||||
EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
|
||||
EFI_HII_IGNORE_LINE_BREAK,
|
||||
&StringRect,
|
||||
&MaxDescent
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
// Render the string to the screen, vertically centered.
|
||||
//
|
||||
|
|
|
@ -1002,7 +1002,9 @@ CheckWatchListCallback (
|
|||
mSWM.bLastMoveRequiredMousePointer = pList->bNeedsMousePointer;
|
||||
|
||||
Client = FilterPointerState (&PointerState);
|
||||
InsertPointerEventIntoQueue (Client, &PointerState);
|
||||
if (Client != NULL) {
|
||||
InsertPointerEventIntoQueue (Client, &PointerState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -376,7 +376,7 @@ MsWheaESCalculateChecksum16 (
|
|||
)
|
||||
{
|
||||
UINT16 Data;
|
||||
UINT8 Index;
|
||||
UINT32 Index;
|
||||
UINT16 Sum;
|
||||
EFI_STATUS Status;
|
||||
|
||||
|
@ -401,7 +401,7 @@ MsWheaESCalculateChecksum16 (
|
|||
Header->Checksum = *Checksum;
|
||||
|
||||
for (Index = 0; Index < Header->ActiveRange; Index += sizeof (Data)) {
|
||||
Status = MsWheaEarlyStorageRead (&Data, sizeof (Data), MS_WHEA_EARLY_STORAGE_DATA_OFFSET + Index);
|
||||
Status = MsWheaEarlyStorageRead (&Data, (UINT8)sizeof (Data), (UINT8)(MS_WHEA_EARLY_STORAGE_DATA_OFFSET + Index));
|
||||
if (EFI_ERROR (Status) != FALSE) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: Reading Early Storage %d failed %r\n", __FUNCTION__, Index, Status));
|
||||
goto Cleanup;
|
||||
|
|
|
@ -636,7 +636,8 @@ MsWheaESProcess (
|
|||
)
|
||||
{
|
||||
EFI_STATUS Status = EFI_SUCCESS;
|
||||
UINT8 Index = 0;
|
||||
UINT32 Index = 0;
|
||||
UINT8 IndexU8;
|
||||
UINT8 mRevInfo;
|
||||
MS_WHEA_ERROR_ENTRY_MD MsWheaEntryMD;
|
||||
MS_WHEA_EARLY_STORAGE_HEADER Header;
|
||||
|
@ -669,9 +670,9 @@ MsWheaESProcess (
|
|||
(Index <= (Header.ActiveRange - sizeof (MS_WHEA_EARLY_STORAGE_ENTRY_COMMON))))
|
||||
{
|
||||
Status = MsWheaESReadData (
|
||||
&mRevInfo,
|
||||
(VOID *)&mRevInfo,
|
||||
sizeof (mRevInfo),
|
||||
Index + OFFSET_OF (MS_WHEA_EARLY_STORAGE_ENTRY_COMMON, Rev)
|
||||
(UINT8)(Index + OFFSET_OF (MS_WHEA_EARLY_STORAGE_ENTRY_COMMON, Rev))
|
||||
);
|
||||
if (EFI_ERROR (Status) != FALSE) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: Early Storage storage read Index %d failed: %r\n", __FUNCTION__, Index, Status));
|
||||
|
@ -681,7 +682,9 @@ MsWheaESProcess (
|
|||
|
||||
switch (mRevInfo) {
|
||||
case MS_WHEA_REV_0:
|
||||
Status = MsWheaESGetV0Info (&MsWheaEntryMD, &Index);
|
||||
IndexU8 = (UINT8)(Index & 0xff);
|
||||
Status = MsWheaESGetV0Info ((VOID *)&MsWheaEntryMD, &IndexU8);
|
||||
Index = IndexU8;
|
||||
if (EFI_ERROR (Status) == FALSE) {
|
||||
Status = ReportFn (&MsWheaEntryMD);
|
||||
} else {
|
||||
|
|
|
@ -59,7 +59,7 @@ class SystemFirmwareTable(object):
|
|||
#Function to get an AcpiTable
|
||||
# return a tuple of error code, table data, and errorstring (None if not error)
|
||||
#
|
||||
def GetAcpiTable(self, TableId):
|
||||
def get_acpi_table(self, TableId):
|
||||
err = 0 #success
|
||||
TableType = struct.unpack(b'>i', b'ACPI')[0] #big endian
|
||||
TableIdAsInt = struct.unpack(b'<i', TableId)[0] #TableId is Little endian or native
|
||||
|
@ -113,7 +113,7 @@ if __name__ == "__main__":
|
|||
# 2. Inspect DMAR
|
||||
#
|
||||
table = SystemFirmwareTable()
|
||||
(errorcode, data, errorstring) = table.GetAcpiTable(b'DMAR')
|
||||
(errorcode, data, errorstring) = table.get_acpi_table(b'DMAR')
|
||||
dmar_table = DMARTable(data)
|
||||
|
||||
DMARTest = dmar_table.DMARBitEnabled()
|
||||
|
|
Загрузка…
Ссылка в новой задаче