Access denied while getting process path

Finally I managed to solve it. As it turned out there is new function in Vista and above for getting process path and new process access (PROCESS_QUERY_LIMITED_INFORMATION): QueryFullProcessImageName Here is the code that works from non-elevated process: private static string GetExecutablePathAboveVista(UIntPtr dwProcessId) { StringBuilder buffer = new StringBuilder(1024); IntPtr hprocess = OpenProcess(ProcessAccessFlags.PROCESS_QUERY_LIMITED_INFORMATION, false, dwProcessId); if … Read more