diff --git a/Cargo.lock b/Cargo.lock
index a60c97063935..50f68e0cd984 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1863,6 +1863,7 @@ dependencies = [
"talpid-platform-metadata",
"talpid-time",
"talpid-types",
+ "talpid-windows",
"tokio",
"tokio-stream",
"winapi",
diff --git a/mullvad-daemon/Cargo.toml b/mullvad-daemon/Cargo.toml
index cc89500abdcf..352db7d9f99a 100644
--- a/mullvad-daemon/Cargo.toml
+++ b/mullvad-daemon/Cargo.toml
@@ -60,6 +60,7 @@ ctrlc = "3.0"
windows-service = "0.6.0"
winapi = { version = "0.3", features = ["winnt", "excpt"] }
dirs = "5.0.1"
+talpid-windows = { path = "../talpid-windows" }
[target.'cfg(windows)'.dependencies.windows-sys]
workspace = true
diff --git a/mullvad-daemon/src/exception_logging/win.rs b/mullvad-daemon/src/exception_logging/win.rs
index 906a8533fcdc..85f16019b05b 100644
--- a/mullvad-daemon/src/exception_logging/win.rs
+++ b/mullvad-daemon/src/exception_logging/win.rs
@@ -1,27 +1,25 @@
use mullvad_paths::log_dir;
use std::{
borrow::Cow,
- ffi::{c_char, c_void, CStr},
+ ffi::c_void,
fmt::Write,
- fs, io, mem,
+ fs, io,
os::windows::io::AsRawHandle,
path::{Path, PathBuf},
ptr,
};
use talpid_types::ErrorExt;
+use talpid_windows::process::{ModuleEntry, ProcessSnapshot};
use winapi::{
um::winnt::{CONTEXT_CONTROL, CONTEXT_INTEGER, CONTEXT_SEGMENTS},
vc::excpt::EXCEPTION_EXECUTE_HANDLER,
};
use windows_sys::Win32::{
- Foundation::{CloseHandle, BOOL, ERROR_NO_MORE_FILES, HANDLE, INVALID_HANDLE_VALUE},
+ Foundation::{BOOL, HANDLE},
System::{
Diagnostics::{
Debug::{SetUnhandledExceptionFilter, CONTEXT, EXCEPTION_POINTERS, EXCEPTION_RECORD},
- ToolHelp::{
- CreateToolhelp32Snapshot, Module32First, Module32Next, MODULEENTRY32,
- TH32CS_SNAPMODULE,
- },
+ ToolHelp::TH32CS_SNAPMODULE,
},
Threading::{GetCurrentProcess, GetCurrentProcessId, GetCurrentThreadId},
},
@@ -291,7 +289,7 @@ fn get_context_info(context: &CONTEXT) -> String {
}
/// Return module info for the current process and given memory address.
-fn find_address_module(address: *mut c_void) -> io::Result