mirror of
https://github.com/8damon/Blackbird-Platform
synced 2026-06-21 13:41:12 +00:00
45 lines
1.5 KiB
C#
45 lines
1.5 KiB
C#
using System;
|
|
|
|
namespace BlackbirdInterface
|
|
{
|
|
public partial class MainWindow
|
|
{
|
|
internal bool MarkInterfaceReady(out string error)
|
|
{
|
|
error = string.Empty;
|
|
|
|
if (!BlackbirdControlDeviceSession.TryOpen(out var control, out error))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
using (control)
|
|
{
|
|
if (!BlackbirdNative.MarkInterfaceReady(control.Handle, unchecked((uint)Environment.ProcessId)))
|
|
{
|
|
error = BlackbirdControlDeviceSession.FormatControlOpenError(
|
|
"MarkInterfaceReady",
|
|
BlackbirdNative.LastError("MarkInterfaceReady failed"));
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
internal bool ApplyStartupRuntimeSelections(bool enableAntiVirtualizationMasking, bool enableControllerConcealment,
|
|
bool enableInterfaceProtectedAccess, bool enableControllerProtectedAccess, out string error)
|
|
{
|
|
var profile = new LaunchProfile
|
|
{
|
|
EnableAntiVirtualizationMasking = enableAntiVirtualizationMasking,
|
|
EnableControllerConcealment = enableControllerConcealment,
|
|
EnableInterfaceProtectedAccess = enableInterfaceProtectedAccess,
|
|
EnableControllerProtectedAccess = enableControllerProtectedAccess
|
|
};
|
|
|
|
return ApplySelectedRuntimeConfig(profile, out error);
|
|
}
|
|
}
|
|
}
|