qol: remove this

This commit is contained in:
Gary Sharp
2025-07-20 11:39:42 +10:00
parent b4e54c9edf
commit 4e518d6684
56 changed files with 282 additions and 282 deletions
+10 -10
View File
@@ -30,15 +30,15 @@ namespace Disco.ClientBootstrapper
public BootstrapperLoop(IStatus StatusUI, LoopCompleteCallback Callback)
{
this.statusUI = StatusUI;
this.mLoopCompleteCallback = Callback;
this.errorMessage = new StringBuilder();
statusUI = StatusUI;
mLoopCompleteCallback = Callback;
errorMessage = new StringBuilder();
}
public void Start()
{
this.LoopThread = new Thread(new ThreadStart(loopHost));
this.LoopThread.Start();
LoopThread = new Thread(new ThreadStart(loopHost));
LoopThread.Start();
}
private void loopHost()
@@ -133,9 +133,9 @@ namespace Disco.ClientBootstrapper
if (!Interop.NetworkInterop.PingDiscoIct(DiscoServerName))
{
// Client Failed
if (this.mLoopCompleteCallback != null)
if (mLoopCompleteCallback != null)
{
this.mLoopCompleteCallback.BeginInvoke(null, null);
mLoopCompleteCallback.BeginInvoke(null, null);
}
return;
}
@@ -197,15 +197,15 @@ namespace Disco.ClientBootstrapper
Interop.CertificateInterop.RemoveTempCerts();
// Pause if Error
if (this.errorMessage.Length > 0)
if (errorMessage.Length > 0)
{
Program.SleepThread(10000, true);
}
// End Of Loop
if (this.mLoopCompleteCallback != null)
if (mLoopCompleteCallback != null)
{
this.mLoopCompleteCallback.BeginInvoke(null, null);
mLoopCompleteCallback.BeginInvoke(null, null);
}
}
+6 -6
View File
@@ -22,9 +22,9 @@ namespace Disco.ClientBootstrapper
public void Start(CompleteCallback Callback)
{
this.mCompleteCallback = Callback;
this.LoopThread = new Thread(new ThreadStart(loopHost));
this.LoopThread.Start();
mCompleteCallback = Callback;
LoopThread = new Thread(new ThreadStart(loopHost));
LoopThread.Start();
}
private void loopHost()
{
@@ -33,10 +33,10 @@ namespace Disco.ClientBootstrapper
//Program.Status.UpdateStatus(null, null, "Testing UI");
//Program.SleepThread(5000, false);
Interop.InstallInterop.Install(this.InstallLocation, this.WimImageId, this.TempPath);
if (this.mCompleteCallback != null)
Interop.InstallInterop.Install(InstallLocation, WimImageId, TempPath);
if (mCompleteCallback != null)
{
this.mCompleteCallback.BeginInvoke(null, null);
mCompleteCallback.BeginInvoke(null, null);
}
}
catch (Exception ex)
@@ -27,28 +27,28 @@ namespace Disco.ClientBootstrapper.Interop
private void UpdateFromWmi(ManagementObject wmiObject)
{
this.WmiPath = (string)wmiObject.GetPropertyValue("__PATH");
this.Index = (UInt32)wmiObject.GetPropertyValue("Index");
this.Guid = Guid.Parse((string)wmiObject.GetPropertyValue("GUID"));
this.MACAddress = (string)wmiObject.GetPropertyValue("MACAddress");
this.Name = (string)wmiObject.GetPropertyValue("Name");
this.NetConnectionID = (string)wmiObject.GetPropertyValue("NetConnectionID");
this.Speed = (UInt64)wmiObject.GetPropertyValue("Speed");
WmiPath = (string)wmiObject.GetPropertyValue("__PATH");
Index = (UInt32)wmiObject.GetPropertyValue("Index");
Guid = Guid.Parse((string)wmiObject.GetPropertyValue("GUID"));
MACAddress = (string)wmiObject.GetPropertyValue("MACAddress");
Name = (string)wmiObject.GetPropertyValue("Name");
NetConnectionID = (string)wmiObject.GetPropertyValue("NetConnectionID");
Speed = (UInt64)wmiObject.GetPropertyValue("Speed");
var connectionStatus = ConnectionStatus;
this.IsWireless = true;
IsWireless = true;
try
{
var wirelessConnectionStatus = WirelessConnectionStatus;
}
catch (Exception) {
this.IsWireless = false;
IsWireless = false;
};
}
public int WirelessConnectionStatus
{
get {
if (this.IsWireless)
if (IsWireless)
{
IntPtr handle = IntPtr.Zero;
uint negotiatedVersion;
@@ -61,17 +61,17 @@ namespace Disco.ClientBootstrapper.Interop
uint dataSize;
var interfaceGuid = this.Guid;
var interfaceGuid = Guid;
if (NetworkInterop.WlanQueryInterface(handle, ref interfaceGuid, NetworkInterop.WLAN_INTF_OPCODE.wlan_intf_opcode_interface_state, IntPtr.Zero, out dataSize, ref ptr, IntPtr.Zero) != 0)
throw new NotSupportedException("This network adapter does not support Wireless");
this.LastWirelessConnectionStatus = Marshal.ReadInt32(ptr);
LastWirelessConnectionStatus = Marshal.ReadInt32(ptr);
NetworkInterop.WlanFreeMemory(ptr);
return this.LastWirelessConnectionStatus;
return LastWirelessConnectionStatus;
}
finally
{
@@ -115,11 +115,11 @@ namespace Disco.ClientBootstrapper.Interop
{
get
{
using (var wmiObject = new ManagementObject(this.WmiPath))
using (var wmiObject = new ManagementObject(WmiPath))
{
this.LastConnectionStatus = (UInt16)wmiObject.GetPropertyValue("NetConnectionStatus");
LastConnectionStatus = (UInt16)wmiObject.GetPropertyValue("NetConnectionStatus");
}
return this.LastConnectionStatus;
return LastConnectionStatus;
}
}
public string ConnectionStatusMeaning(UInt16 status)
@@ -239,7 +239,7 @@ namespace Disco.ClientBootstrapper.Interop
public bool AddProfile(IntPtr WlanHandle, Guid interfaceGuid)
{
var pInterfaceGuid = interfaceGuid;
var pProfileXml = this.ProfileXml;
var pProfileXml = ProfileXml;
uint pFlag = 0;
uint failReason;
return (WlanSetProfile(WlanHandle, ref pInterfaceGuid, pFlag, pProfileXml, null, true, IntPtr.Zero, out failReason) == 0);
@@ -80,20 +80,20 @@ namespace Disco.ClientBootstrapper.Interop
uint regHive = (uint)hive;
this.Hive = hive;
this.SubKey = subKey;
Hive = hive;
SubKey = subKey;
RegLoadKey(regHive, subKey, filePath);
this.IsUnloaded = false;
IsUnloaded = false;
}
public void Unload()
{
if (!IsUnloaded)
{
uint regHive = (uint)this.Hive;
string subKey = this.SubKey;
uint regHive = (uint)Hive;
string subKey = SubKey;
RegUnLoadKey(regHive, subKey);
this.IsUnloaded = true;
IsUnloaded = true;
}
}
@@ -480,7 +480,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop
//
//Never commit changes when destroying this object.
//
this.DismountImage(false);
DismountImage(false);
}
GC.KeepAlive(this);
}