我正在使用EasyHook
dll 并执行DoDragDrop
API 挂钩,一切正常,但如何释放以下 3 个 dll
1. EasyHook.dll
2. EasyHook64.dll
3.EasyLoad64.dll
即使在关闭我的应用程序后,这些 dll 也会被挂钩explorer.exe
,一旦我重新启动 explorer.exe,它们就会释放
到目前为止我没有找到任何解决方案,所以我在这里发布,请帮助我解决这个问题。
下面是我的 DLLRun()
代码片段。
public void Run(RemoteHooking.IContext InContext, String InChannelName)
{
try
{
dragDropHook = LocalHook.Create(LocalHook.GetProcAddress("Ole32.dll", "DoDragDrop"), new DragDropDelegate(DoDragDropHook), this);
dragDropHook.ThreadACL.SetExclusiveACL(new Int32[] { 0 });
File.AppendAllText(logFilePath, "Run : LocalHook Created" + Environment.NewLine);
}
catch (Exception ex)
{
Interface.ErrorHandle(ex);
File.AppendAllText(logFilePath, "Run Exception :" + ex.ToString() + Environment.NewLine);
return;
}
Interface.IsInstalled(RemoteHooking.GetCurrentProcessId());
RemoteHooking.WakeUpProcess();
File.AppendAllText(logFilePath, "Running " + Environment.NewLine);
while (checkforDesktopExe())
{
Thread.Sleep(1000);
}
if (dragDropHook != null)
{
// Remove hooks
dragDropHook.Dispose();
// Finalise cleanup of hooks
LocalHook.Release();
File.AppendAllText(logFilePath, "Disposed " + Environment.NewLine);
}
}