mirror of
https://github.com/MobileTooling/UnifiedFlashingPlatform.git
synced 2026-07-27 12:48:47 -07:00
fixes for write param
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace UnifiedFlashingPlatform
|
||||
{
|
||||
@@ -27,7 +24,7 @@ namespace UnifiedFlashingPlatform
|
||||
byte[] ParamBuffer = new byte[540 + Data.Length];
|
||||
|
||||
/* 15..30 */ Buffer.BlockCopy(Guid.ToByteArray(), 0, ParamBuffer, 0, 16);
|
||||
/* 31..34 */ Buffer.BlockCopy(BigEndian.GetBytes(Name.Length * 2, 4), 0, ParamBuffer, 16, 4);
|
||||
/* 31..34 */ Buffer.BlockCopy(BigEndian.GetBytes(Math.Min(512, Name.Length * 2), 4), 0, ParamBuffer, 16, 4);
|
||||
/* 35.. */ Buffer.BlockCopy(Encoding.Unicode.GetBytes(Name), 0, ParamBuffer, 20, Math.Min(512, Name.Length * 2)); // 256 Max Size for name (unicode)
|
||||
/* 547..550 */ Buffer.BlockCopy(BigEndian.GetBytes(Attributes, 4), 0, ParamBuffer, 532, 4);
|
||||
/* 551..554 */ Buffer.BlockCopy(BigEndian.GetBytes(Data.Length, 4), 0, ParamBuffer, 536, 4);
|
||||
@@ -35,5 +32,15 @@ namespace UnifiedFlashingPlatform
|
||||
|
||||
WriteParam(SettingUEFIVariableWriteParamSignature, ParamBuffer);
|
||||
}
|
||||
|
||||
public void SetOneTimeBootSequence(uint BootEntryID)
|
||||
{
|
||||
WriteParam(OneTimeBootSequenceWriteParamSignature, BigEndian.GetBytes(BootEntryID, 4));
|
||||
}
|
||||
|
||||
public void SetProgressBar(uint Percentage)
|
||||
{
|
||||
WriteParam("PBI\0", BigEndian.GetBytes(Percentage, 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user