Closed caesay closed 8 months ago
The problem indeed seems to be those garbled characters in pacman.exe
description. That's a problem with the executable itself. Then, in order to deal with these, the library should be able to deal with an UTF16 error, which doesn't seem hard to implement.
But anyway, please post your source code, so I can have an idea of what's really going on.
Just open a handle to that process and try to get the image name:
let process = w::HPROCESS::OpenProcess(co::PROCESS::QUERY_LIMITED_INFORMATION, false, pid)?;
let full_path = process.QueryFullProcessImageName(co::PROCESS_NAME::WIN32)?;
Since that function already returns a Result, it should ideally propagate the encoding errors the same way rather than panicking
I implemented a specific error treatment for invalid UTF-16 strings, which should not panic anymore.
Let me know if this works.
On 0.0.19, QueryFullProcessImageName panic'd. The process it was trying to read was pacman.exe (from mingw64).
I tried building from source but there were compile errors, so left it there. Hope it helps. Ideally this would return an error instead of a panic.
Backtrace: