Page 1 of 1

InjectLibrary Fails

Posted: Thu Apr 10, 2014 5:55 am
by manutai
I called InjectLibrary for 32 bit dll and then i called InjectLibrary for injecting 64 bit dll in first case its success means returning -1 but in second case it returning zero means failure. and getlasterror system call returning me with error no 50 = "The request is not supported." .what should i do please response me fast waiting.

Re: InjectLibrary Fails

Posted: Thu Apr 10, 2014 7:16 am
by madshi
Did you call this from a 32bit or 64bit exe? Injection into 64bit processes only works if your injection process is 64bit, too.

Re: InjectLibrary Fails

Posted: Thu Apr 10, 2014 8:28 am
by manutai
its a 32 bit service which calls this inject library

Re: InjectLibrary Fails

Posted: Thu Apr 10, 2014 10:37 am
by madshi
You've got to compile a 64bit exe to inject the 64bit hook dll. You can either compile a 64bit version of your service, or alternatively just create a small 64bit helper exe which does nothing but inject/unininject, via command line parameters or something like that. Your 32bit service could then call the 64bit helper exe.