RhInjectLibrary() doesn't work under Vista/7 with UAC: OpenProcess() fails

Mar 30, 2011 at 8:36 AM
Edited Mar 30, 2011 at 8:43 AM

Greetings.

I'm trying to use RhInjectLibrary() to inject my unmanaged DLL into another process of same user and bitness under Vista/7 with UAC enabled. It fails at thread.c:786 on OpenProcess(PROCESS_ALL_ACCESS, FALSE, InTargetPID)) - it returns NULL and GetLastError() is ACESS_DENIED.

Injecting to child process started from my DLL works fine. Injecting with disabled UAC works fine too.

I've even wrote manifest with "requireAdministrator" for my application that calls RhInjectLibrary() and I'm also setting SeDebugPrivilege before calling it - doesn't help.

Jul 4, 2013 at 2:56 AM
I have the same problem.
Whether your problem have been solved?

My OpenProcess(PROCESS_ALL_ACCESS, FALSE, InTargetPID)) return 0xffffffff, I think there are protective measures. What should I do before call RhInjectLibrary()?