提交 0701d155 编写于 作者: V vit9696

OcMainLib: Implement automatic scaling factor detection

closes acidanthera/bugtracker#1717
上级 a41d4806
...@@ -2,6 +2,7 @@ OpenCore Changelog ...@@ -2,6 +2,7 @@ OpenCore Changelog
================== ==================
#### v0.7.6 #### v0.7.6
- Fixed stack canary support when compiling with GCC - Fixed stack canary support when compiling with GCC
- Added automatic scaling factor detection
#### v0.7.5 #### v0.7.5
- Revised OpenLinuxBoot documentation - Revised OpenLinuxBoot documentation
......
...@@ -7366,6 +7366,21 @@ with the boot menu. ...@@ -7366,6 +7366,21 @@ with the boot menu.
On all known affected systems, \texttt{ConsoleMode} must be set to On all known affected systems, \texttt{ConsoleMode} must be set to
an empty string for this option to work. an empty string for this option to work.
\item
\texttt{UIScale}\\
\textbf{Type}: \texttt{plist\ integer}, 8 bit\\
\textbf{Failsafe}: \texttt{-1}\\
\textbf{Description}: User interface scaling factor.
Corresponds to \texttt{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:UIScale} variable.
\begin{itemize}
\tightlist
\item \texttt{1} --- 1x scaling, corresponds to normal displays.
\item \texttt{2} --- 2x scaling, corresponds to HiDPI displays.
\item \texttt{-1} --- leaves the current variable unchanged.
\item \texttt{0} --- automatically chooses scaling based on the current resolution.
\end{itemize}
\item \item
\texttt{UgaPassThrough}\\ \texttt{UgaPassThrough}\\
\textbf{Type}: \texttt{plist\ boolean}\\ \textbf{Type}: \texttt{plist\ boolean}\\
......
\documentclass[]{article} \documentclass[]{article}
%DIF LATEXDIFF DIFFERENCE FILE %DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Tue Nov 2 10:35:43 2021 %DIF DEL PreviousConfiguration.tex Wed Nov 3 14:16:04 2021
%DIF ADD ../Configuration.tex Tue Nov 2 10:37:48 2021 %DIF ADD ../Configuration.tex Thu Nov 4 18:02:19 2021
\usepackage{lmodern} \usepackage{lmodern}
\usepackage{amssymb,amsmath} \usepackage{amssymb,amsmath}
...@@ -7425,6 +7425,24 @@ with the boot menu. ...@@ -7425,6 +7425,24 @@ with the boot menu.
\emph{Note}: This option only applies to the \texttt{System} renderer. \emph{Note}: This option only applies to the \texttt{System} renderer.
On all known affected systems, \texttt{ConsoleMode} must be set to On all known affected systems, \texttt{ConsoleMode} must be set to
an empty string for this option to work. an empty string for this option to work.
\DIFaddbegin
\item
\texttt{\DIFadd{UIScale}}\\
\textbf{\DIFadd{Type}}\DIFadd{: }\texttt{\DIFadd{plist\ integer}}\DIFadd{, 8 bit}\\
\textbf{\DIFadd{Failsafe}}\DIFadd{: }\texttt{\DIFadd{-1}}\\
\textbf{\DIFadd{Description}}\DIFadd{: User interface scaling factor.
}
\DIFadd{Corresponds to }\texttt{\DIFadd{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:UIScale}} \DIFadd{variable.
}\begin{itemize}
\tightlist
\item \texttt{\DIFadd{1}} \DIFadd{--- 1x scaling, corresponds to normal displays.
}\item \texttt{\DIFadd{2}} \DIFadd{--- 2x scaling, corresponds to HiDPI displays.
}\item \texttt{\DIFadd{-1}} \DIFadd{--- leaves the current variable unchanged.
}\item \texttt{\DIFadd{0}} \DIFadd{--- automatically chooses scaling based on the current resolution.
}\end{itemize}
\DIFaddend
\item \item
\texttt{UgaPassThrough}\\ \texttt{UgaPassThrough}\\
......
...@@ -1132,8 +1132,6 @@ ...@@ -1132,8 +1132,6 @@
<dict> <dict>
<key>DefaultBackgroundColor</key> <key>DefaultBackgroundColor</key>
<data>AAAAAA==</data> <data>AAAAAA==</data>
<key>UIScale</key>
<data>AQ==</data>
</dict> </dict>
<key>4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102</key> <key>4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102</key>
<dict> <dict>
...@@ -1160,7 +1158,6 @@ ...@@ -1160,7 +1158,6 @@
<dict> <dict>
<key>4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14</key> <key>4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14</key>
<array> <array>
<string>UIScale</string>
<string>DefaultBackgroundColor</string> <string>DefaultBackgroundColor</string>
</array> </array>
<key>4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102</key> <key>4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102</key>
...@@ -1513,6 +1510,8 @@ ...@@ -1513,6 +1510,8 @@
<false/> <false/>
<key>TextRenderer</key> <key>TextRenderer</key>
<string>BuiltinGraphics</string> <string>BuiltinGraphics</string>
<key>UIScale</key>
<integer>0</integer>
<key>UgaPassThrough</key> <key>UgaPassThrough</key>
<false/> <false/>
</dict> </dict>
......
...@@ -1132,8 +1132,6 @@ ...@@ -1132,8 +1132,6 @@
<dict> <dict>
<key>DefaultBackgroundColor</key> <key>DefaultBackgroundColor</key>
<data>AAAAAA==</data> <data>AAAAAA==</data>
<key>UIScale</key>
<data>AQ==</data>
</dict> </dict>
<key>4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102</key> <key>4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102</key>
<dict> <dict>
...@@ -1158,7 +1156,6 @@ ...@@ -1158,7 +1156,6 @@
<dict> <dict>
<key>4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14</key> <key>4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14</key>
<array> <array>
<string>UIScale</string>
<string>DefaultBackgroundColor</string> <string>DefaultBackgroundColor</string>
</array> </array>
<key>4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102</key> <key>4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102</key>
...@@ -1851,6 +1848,8 @@ ...@@ -1851,6 +1848,8 @@
<false/> <false/>
<key>TextRenderer</key> <key>TextRenderer</key>
<string>BuiltinGraphics</string> <string>BuiltinGraphics</string>
<key>UIScale</key>
<integer>0</integer>
<key>UgaPassThrough</key> <key>UgaPassThrough</key>
<false/> <false/>
</dict> </dict>
......
...@@ -651,6 +651,7 @@ typedef enum { ...@@ -651,6 +651,7 @@ typedef enum {
_(BOOLEAN , ReplaceTabWithSpace , , FALSE , ()) \ _(BOOLEAN , ReplaceTabWithSpace , , FALSE , ()) \
_(BOOLEAN , ReconnectOnResChange , , FALSE , ()) \ _(BOOLEAN , ReconnectOnResChange , , FALSE , ()) \
_(BOOLEAN , SanitiseClearScreen , , FALSE , ()) \ _(BOOLEAN , SanitiseClearScreen , , FALSE , ()) \
_(INT8 , UIScale , , -1 , ()) \
_(BOOLEAN , UgaPassThrough , , FALSE , ()) \ _(BOOLEAN , UgaPassThrough , , FALSE , ()) \
_(BOOLEAN , DirectGopRendering , , FALSE , ()) \ _(BOOLEAN , DirectGopRendering , , FALSE , ()) \
_(BOOLEAN , ForceResolution , , FALSE , ()) _(BOOLEAN , ForceResolution , , FALSE , ())
......
...@@ -40,6 +40,7 @@ OcVariableInit ( ...@@ -40,6 +40,7 @@ OcVariableInit (
EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not
be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated). be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated).
@param[in] Data The contents for the variable. @param[in] Data The contents for the variable.
@param[in] VendorGuid Variable GUID, defaults to gOcVendorVariableGuid if NULL.
@retval EFI_SUCCESS The firmware has successfully stored the variable and its data as @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
defined by the Attributes. defined by the Attributes.
...@@ -57,10 +58,11 @@ OcVariableInit ( ...@@ -57,10 +58,11 @@ OcVariableInit (
**/ **/
EFI_STATUS EFI_STATUS
OcSetSystemVariable ( OcSetSystemVariable (
IN CHAR16 *VariableName, IN CHAR16 *VariableName,
IN UINT32 Attributes, IN UINT32 Attributes,
IN UINTN DataSize, IN UINTN DataSize,
IN VOID *Data IN VOID *Data,
IN EFI_GUID *VendorGuid OPTIONAL
); );
#endif // OC_VARIABLE_LIB_H #endif // OC_VARIABLE_LIB_H
...@@ -786,6 +786,7 @@ mUefiOutputSchema[] = { ...@@ -786,6 +786,7 @@ mUefiOutputSchema[] = {
OC_SCHEMA_STRING_IN ("Resolution", OC_GLOBAL_CONFIG, Uefi.Output.Resolution), OC_SCHEMA_STRING_IN ("Resolution", OC_GLOBAL_CONFIG, Uefi.Output.Resolution),
OC_SCHEMA_BOOLEAN_IN ("SanitiseClearScreen", OC_GLOBAL_CONFIG, Uefi.Output.SanitiseClearScreen), OC_SCHEMA_BOOLEAN_IN ("SanitiseClearScreen", OC_GLOBAL_CONFIG, Uefi.Output.SanitiseClearScreen),
OC_SCHEMA_STRING_IN ("TextRenderer", OC_GLOBAL_CONFIG, Uefi.Output.TextRenderer), OC_SCHEMA_STRING_IN ("TextRenderer", OC_GLOBAL_CONFIG, Uefi.Output.TextRenderer),
OC_SCHEMA_INTEGER_IN ("UIScale", OC_GLOBAL_CONFIG, Uefi.Output.UIScale),
OC_SCHEMA_BOOLEAN_IN ("UgaPassThrough", OC_GLOBAL_CONFIG, Uefi.Output.UgaPassThrough), OC_SCHEMA_BOOLEAN_IN ("UgaPassThrough", OC_GLOBAL_CONFIG, Uefi.Output.UgaPassThrough),
}; };
......
...@@ -69,7 +69,8 @@ OcStoreLoadPath ( ...@@ -69,7 +69,8 @@ OcStoreLoadPath (
OC_LOG_VARIABLE_PATH, OC_LOG_VARIABLE_PATH,
OPEN_CORE_NVRAM_ATTR, OPEN_CORE_NVRAM_ATTR,
AsciiStrSize (OutPath), AsciiStrSize (OutPath),
OutPath OutPath,
NULL
); );
DEBUG (( DEBUG ((
...@@ -659,7 +660,8 @@ OcMiscMiddleInit ( ...@@ -659,7 +660,8 @@ OcMiscMiddleInit (
OC_BOOT_PROTECT_VARIABLE_NAME, OC_BOOT_PROTECT_VARIABLE_NAME,
OPEN_CORE_INT_NVRAM_ATTR, OPEN_CORE_INT_NVRAM_ATTR,
sizeof (BootProtectFlag), sizeof (BootProtectFlag),
&BootProtectFlag &BootProtectFlag,
NULL
); );
} }
...@@ -981,6 +983,7 @@ OcMiscUefiQuirksLoaded ( ...@@ -981,6 +983,7 @@ OcMiscUefiQuirksLoaded (
OC_SCAN_POLICY_VARIABLE_NAME, OC_SCAN_POLICY_VARIABLE_NAME,
OPEN_CORE_INT_NVRAM_ATTR, OPEN_CORE_INT_NVRAM_ATTR,
sizeof (Config->Misc.Security.ScanPolicy), sizeof (Config->Misc.Security.ScanPolicy),
&Config->Misc.Security.ScanPolicy &Config->Misc.Security.ScanPolicy,
NULL
); );
} }
...@@ -91,14 +91,16 @@ OcReportVersion ( ...@@ -91,14 +91,16 @@ OcReportVersion (
OC_VERSION_VARIABLE_NAME, OC_VERSION_VARIABLE_NAME,
OPEN_CORE_NVRAM_ATTR, OPEN_CORE_NVRAM_ATTR,
AsciiStrLen (Version), AsciiStrLen (Version),
(VOID *) Version (VOID *) Version,
NULL
); );
} else { } else {
OcSetSystemVariable ( OcSetSystemVariable (
OC_VERSION_VARIABLE_NAME, OC_VERSION_VARIABLE_NAME,
OPEN_CORE_NVRAM_ATTR, OPEN_CORE_NVRAM_ATTR,
L_STR_LEN ("UNK-000-0000-00-00"), L_STR_LEN ("UNK-000-0000-00-00"),
"UNK-000-0000-00-00" "UNK-000-0000-00-00",
NULL
); );
} }
} }
......
...@@ -858,7 +858,8 @@ OcLoadUefiSupport ( ...@@ -858,7 +858,8 @@ OcLoadUefiSupport (
OC_BOOT_REDIRECT_VARIABLE_NAME, OC_BOOT_REDIRECT_VARIABLE_NAME,
OPEN_CORE_INT_NVRAM_ATTR, OPEN_CORE_INT_NVRAM_ATTR,
sizeof (Config->Uefi.Quirks.RequestBootVarRouting), sizeof (Config->Uefi.Quirks.RequestBootVarRouting),
&Config->Uefi.Quirks.RequestBootVarRouting &Config->Uefi.Quirks.RequestBootVarRouting,
NULL
); );
if (Config->Uefi.Quirks.UnblockFsConnect) { if (Config->Uefi.Quirks.UnblockFsConnect) {
......
...@@ -16,6 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ...@@ -16,6 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/OcVariable.h> #include <Guid/OcVariable.h>
#include <Guid/GlobalVariable.h> #include <Guid/GlobalVariable.h>
#include <Guid/AppleVariable.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
...@@ -40,6 +41,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ...@@ -40,6 +41,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/OcMiscLib.h> #include <Library/OcMiscLib.h>
#include <Library/OcSmcLib.h> #include <Library/OcSmcLib.h>
#include <Library/OcOSInfoLib.h> #include <Library/OcOSInfoLib.h>
#include <Library/OcVariableLib.h>
#include <Library/PrintLib.h> #include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h> #include <Library/UefiLib.h>
...@@ -182,14 +184,16 @@ OcLoadUefiOutputSupport ( ...@@ -182,14 +184,16 @@ OcLoadUefiOutputSupport (
IN OC_GLOBAL_CONFIG *Config IN OC_GLOBAL_CONFIG *Config
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
CONST CHAR8 *AsciiRenderer; CONST CHAR8 *AsciiRenderer;
CONST CHAR8 *GopPassThrough; CONST CHAR8 *GopPassThrough;
OC_CONSOLE_RENDERER Renderer; EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop;
UINT32 Width; OC_CONSOLE_RENDERER Renderer;
UINT32 Height; UINT32 Width;
UINT32 Bpp; UINT32 Height;
BOOLEAN SetMax; UINT32 Bpp;
BOOLEAN SetMax;
UINT8 UIScale;
GopPassThrough = OC_BLOB_GET (&Config->Uefi.Output.GopPassThrough); GopPassThrough = OC_BLOB_GET (&Config->Uefi.Output.GopPassThrough);
if (AsciiStrCmp (GopPassThrough, "Enabled") == 0) { if (AsciiStrCmp (GopPassThrough, "Enabled") == 0) {
...@@ -273,6 +277,40 @@ OcLoadUefiOutputSupport ( ...@@ -273,6 +277,40 @@ OcLoadUefiOutputSupport (
} }
} }
if (Config->Uefi.Output.UIScale >= 0 && Config->Uefi.Output.UIScale <= 2) {
if (Config->Uefi.Output.UIScale == 0) {
Status = gBS->HandleProtocol (
gST->ConsoleOutHandle,
&gEfiGraphicsOutputProtocolGuid,
(VOID **) &Gop
);
if (!EFI_ERROR (Status)) {
UIScale = (UINT64) Gop->Mode->Info->HorizontalResolution
* Gop->Mode->Info->VerticalResolution >= 4000000 ? 2 : 1;
DEBUG ((
DEBUG_INFO,
"OC: Selected UIScale %d based on %ux%u resolution\n",
UIScale,
Gop->Mode->Info->HorizontalResolution,
Gop->Mode->Info->VerticalResolution
));
} else {
UIScale = 1;
}
} else {
UIScale = (UINT8) Config->Uefi.Output.UIScale;
}
Status = OcSetSystemVariable (
APPLE_UI_SCALE_VARIABLE_NAME,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
sizeof (UIScale),
&UIScale,
&gAppleVendorVariableGuid
);
DEBUG ((DEBUG_INFO, "OC: Setting UIScale to %d - %r\n", UIScale, Status));
}
AsciiRenderer = OC_BLOB_GET (&Config->Uefi.Output.TextRenderer); AsciiRenderer = OC_BLOB_GET (&Config->Uefi.Output.TextRenderer);
if (AsciiRenderer[0] == '\0' || AsciiStrCmp (AsciiRenderer, "BuiltinGraphics") == 0) { if (AsciiRenderer[0] == '\0' || AsciiStrCmp (AsciiRenderer, "BuiltinGraphics") == 0) {
......
...@@ -2348,7 +2348,8 @@ OcSmbiosExtractOemInfo ( ...@@ -2348,7 +2348,8 @@ OcSmbiosExtractOemInfo (
OC_OEM_PRODUCT_VARIABLE_NAME, OC_OEM_PRODUCT_VARIABLE_NAME,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
AsciiStrLen (SmProductName), AsciiStrLen (SmProductName),
(VOID *) SmProductName (VOID *) SmProductName,
NULL
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCSMB: Cannot write OEM product\n")); DEBUG ((DEBUG_INFO, "OCSMB: Cannot write OEM product\n"));
...@@ -2360,7 +2361,8 @@ OcSmbiosExtractOemInfo ( ...@@ -2360,7 +2361,8 @@ OcSmbiosExtractOemInfo (
OC_OEM_VENDOR_VARIABLE_NAME, OC_OEM_VENDOR_VARIABLE_NAME,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
AsciiStrLen (SmManufacturer), AsciiStrLen (SmManufacturer),
(VOID *) SmManufacturer (VOID *) SmManufacturer,
NULL
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCSMB: Cannot write OEM board manufacturer - %r\n", Status)); DEBUG ((DEBUG_INFO, "OCSMB: Cannot write OEM board manufacturer - %r\n", Status));
...@@ -2370,7 +2372,8 @@ OcSmbiosExtractOemInfo ( ...@@ -2370,7 +2372,8 @@ OcSmbiosExtractOemInfo (
OC_OEM_BOARD_VARIABLE_NAME, OC_OEM_BOARD_VARIABLE_NAME,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
AsciiStrLen (SmBoard), AsciiStrLen (SmBoard),
(VOID *) SmBoard (VOID *) SmBoard,
NULL
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCSMB: Cannot write OEM board - %r\n", Status)); DEBUG ((DEBUG_INFO, "OCSMB: Cannot write OEM board - %r\n", Status));
......
...@@ -575,7 +575,8 @@ ExportStatusKey ( ...@@ -575,7 +575,8 @@ ExportStatusKey (
VIRTUALSMC_STATUS_KEY, VIRTUALSMC_STATUS_KEY,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
sizeof (StatusBuffer), sizeof (StatusBuffer),
StatusBuffer StatusBuffer,
NULL
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCSMC: Failed to create status - %r\n", Status)); DEBUG ((DEBUG_INFO, "OCSMC: Failed to create status - %r\n", Status));
......
...@@ -33,10 +33,11 @@ OcVariableInit ( ...@@ -33,10 +33,11 @@ OcVariableInit (
EFI_STATUS EFI_STATUS
OcSetSystemVariable ( OcSetSystemVariable (
IN CHAR16 *VariableName, IN CHAR16 *VariableName,
IN UINT32 Attributes, IN UINT32 Attributes,
IN UINTN DataSize, IN UINTN DataSize,
IN VOID *Data IN VOID *Data,
IN EFI_GUID *VendorGuid OPTIONAL
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
...@@ -47,6 +48,10 @@ OcSetSystemVariable ( ...@@ -47,6 +48,10 @@ OcSetSystemVariable (
UINT8 StackBuffer[256]; UINT8 StackBuffer[256];
if (VendorGuid == NULL) {
VendorGuid = &gOcVendorVariableGuid;
}
DEBUG_CODE_BEGIN (); DEBUG_CODE_BEGIN ();
ASSERT (mDebugInitialized); ASSERT (mDebugInitialized);
DEBUG_CODE_END (); DEBUG_CODE_END ();
...@@ -68,7 +73,7 @@ OcSetSystemVariable ( ...@@ -68,7 +73,7 @@ OcSetSystemVariable (
Status = gRT->GetVariable ( Status = gRT->GetVariable (
VariableName, VariableName,
&gOcVendorVariableGuid, VendorGuid,
NULL, NULL,
&OldDataSize, &OldDataSize,
OldData OldData
...@@ -81,7 +86,7 @@ OcSetSystemVariable ( ...@@ -81,7 +86,7 @@ OcSetSystemVariable (
if (OldData != NULL) { if (OldData != NULL) {
Status = gRT->GetVariable ( Status = gRT->GetVariable (
VariableName, VariableName,
&gOcVendorVariableGuid, VendorGuid,
NULL, NULL,
&OldDataSize, &OldDataSize,
OldData OldData
...@@ -123,7 +128,7 @@ OcSetSystemVariable ( ...@@ -123,7 +128,7 @@ OcSetSystemVariable (
return gRT->SetVariable ( return gRT->SetVariable (
VariableName, VariableName,
&gOcVendorVariableGuid, VendorGuid,
Attributes, Attributes,
DataSize, DataSize,
Data Data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册