mirror of
https://github.com/mastercodeon314/KsDumper-11.git
synced 2024-11-30 17:24:32 +01:00
Fixed a bug that wouldn't allow the form to unload the driver on program exit.
This commit is contained in:
parent
a165027b78
commit
b7cc4a3dfc
@ -132,9 +132,16 @@ namespace KsDumper11.Driver
|
||||
private readonly IntPtr driverHandle;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
WinApi.CloseHandle(driverHandle);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
~DriverInterface()
|
||||
{
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -105,6 +105,7 @@ namespace KsDumper11
|
||||
this.InitializeComponent();
|
||||
closeDriverOnExitBox.Checked = Properties.Settings.Default.closeDriverOnExitSettings;
|
||||
this.FormClosing += Dumper_FormClosing;
|
||||
this.Disposed += Dumper_Disposed;
|
||||
this.appIcon1.DragForm = this;
|
||||
base.FormBorderStyle = FormBorderStyle.None;
|
||||
base.Region = Region.FromHrgn(Utils.CreateRoundRectRgn(0, 0, base.Width, base.Height, 10, 10));
|
||||
@ -123,6 +124,14 @@ namespace KsDumper11
|
||||
this.LoadProcessList();
|
||||
}
|
||||
|
||||
private void Dumper_Disposed(object sender, EventArgs e)
|
||||
{
|
||||
if (Properties.Settings.Default.closeDriverOnExitSettings)
|
||||
{
|
||||
driver.UnloadDriver();
|
||||
}
|
||||
}
|
||||
|
||||
private void closeDriverOnExitBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.closeDriverOnExitSettings = closeDriverOnExitBox.Checked;
|
||||
|
Loading…
Reference in New Issue
Block a user