mirror of
https://github.com/ReneLergner/WPinternals.git
synced 2026-06-14 03:16:40 +10:00
Added listening for the HID interface (charging) and bug fixing
This commit is contained in:
@@ -156,10 +156,12 @@ namespace WPinternals
|
||||
return Result;
|
||||
}
|
||||
|
||||
internal bool IsBootLoaderUnlocked()
|
||||
internal bool? IsBootLoaderUnlocked()
|
||||
{
|
||||
UefiSecurityStatusResponse SecurityStatus = ReadSecurityStatus();
|
||||
return (SecurityStatus.AuthenticationStatus || SecurityStatus.RdcStatus || !SecurityStatus.SecureFfuEfuseStatus);
|
||||
if (SecurityStatus != null)
|
||||
return (SecurityStatus.AuthenticationStatus || SecurityStatus.RdcStatus || !SecurityStatus.SecureFfuEfuseStatus);
|
||||
return null;
|
||||
}
|
||||
|
||||
public TerminalResponse GetTerminalResponse()
|
||||
@@ -651,7 +653,8 @@ namespace WPinternals
|
||||
|
||||
internal void WriteGPT(GPT NewGPT)
|
||||
{
|
||||
if (!IsBootLoaderUnlocked())
|
||||
bool? unlocked = IsBootLoaderUnlocked();
|
||||
if (unlocked.HasValue && !unlocked.Value)
|
||||
throw new InvalidOperationException("Bootloader is not unlocked!");
|
||||
|
||||
byte[] Buffer = NewGPT.Rebuild();
|
||||
@@ -690,7 +693,8 @@ namespace WPinternals
|
||||
|
||||
private void FlashRawPartition(string Path, Stream Stream, string PartitionName, Action<int, TimeSpan?> ProgressUpdateCallback, ProgressUpdater UpdaterPerSector)
|
||||
{
|
||||
if (!IsBootLoaderUnlocked())
|
||||
bool? unlocked = IsBootLoaderUnlocked();
|
||||
if (unlocked.HasValue && !unlocked.Value)
|
||||
throw new InvalidOperationException("Bootloader is not unlocked!");
|
||||
|
||||
GPT GPT = ReadGPT();
|
||||
|
||||
Reference in New Issue
Block a user