keyhac 経由でお世話になっているのですが、最近のプロセスでは現在の方法だと getProcessPath が例外を上げてきます。
引用元: https://docs.microsoft.com/ja-jp/windows/win32/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot
If the specified process is a 64-bit process and the caller is a 32-bit process, this function fails and the last error code is ERROR_PARTIAL_COPY (299).