Page 1 of 1

CreateProcessEx failing on 32 bit Windows 7

Posted: Wed Nov 13, 2019 1:05 pm
by hardik.choudhary
HI
I tried CreateProcessEx on a 32 bit Windows 7, it fails with GetLastError() 123(ERROR_INVALID_NAME). Any suggestions as to why this could be?
Thanks

Re: CreateProcessEx failing on 32 bit Windows 7

Posted: Wed Nov 13, 2019 1:51 pm
by iconic
Does the same thing happen with the regular Win32 API CreateProcessA/W? Obviously, you wouldn't append the extra DLL name parameter.
That error code is usually a result of needing to relocate param 1 (ApplicationName) to param 2 (Commandline), make sure to set param 1
to NULL if you end up using param 2. If you're still getting the error please post your call parameters so we can see them

--Iconic

Re: CreateProcessEx failing on 32 bit Windows 7

Posted: Thu Nov 14, 2019 6:34 am
by hardik.choudhary
Thanks, I tried that but same error. It's a createProcessW callback, and the same parameters that were there for CreateProcessW are passed into CreateProcessExW along with the extra dll. Funny thing is it works for a 64 bit OS opening a 32 bit process, so I know the callback code, and what I'm injecting works there. Is there an environment related issue, that might be interfering? (GetLastError() 123)?

Re: CreateProcessEx failing on 32 bit Windows 7

Posted: Thu Nov 14, 2019 6:42 am
by iconic
Hello,

Thanks for replying. Hmmm, can you upload a sample project
or show code? I’ll test before the weekend and try to reproduce,
but it may be hard, depending on the params etc. Will try however

--Iconic

Re: CreateProcessEx failing on 32 bit Windows 7

Posted: Thu Nov 14, 2019 6:48 am
by iconic
One last quick check, does this happen with CreateProcessExA() ? The cmdline is very different here, believe it or not, and it’s mentioned on MSDN. Basically, you shouldn’t use a literal/const string, but a buffer for the commandline arg

P.S: We really can help more with a code sample, otherwise we are reduced to *guess*work

--Iconic

Re: CreateProcessEx failing on 32 bit Windows 7

Posted: Thu Nov 14, 2019 11:18 am
by hardik.choudhary
"Basically, you shouldn’t use a literal/const string, but a buffer for the commandline arg", yes I've learnt that the hard way.

It's fine, it was a different issue, altogether.

Thanks for your time and suggestions.

Re: CreateProcessEx failing on 32 bit Windows 7

Posted: Thu Nov 14, 2019 1:02 pm
by iconic
Glad the issue is resolved. Thanks for letting us know

—Iconic