I have problems with CreateProcess.

Now I use ShellExecute to execute a program and pass it a parameter


invoke ShellExecute, 0, offset ShellOpen, addr MameName, addr MamePar, offset MameDir, SW_SHOWNORMAL


but I want to use CreateProcess

This is the code



MameName db "d:\mame\mame068b_i686\mamepp.exe",0
MameDir db "d:\mame\mame068b_i686\",0
MamePar db "19xx",0

xor eax, eax
mov sif.cb, sizeof STARTUPINFO
mov sif.lpReserved, eax
mov sif.lpDesktop, eax
mov sif.lpTitle, eax
mov sif.dwFlags, 0
mov sif.cbReserved2, 0
mov sif.lpReserved2, 0

invoke CreateProcess, addr MameName, addr MamePar, NULL, NULL, FALSE, 0, NULL, addr MameDir, addr sif, addr pif


This code doesn't work. It seems that the newprocess doesn't get the parameter

Why?
Posted on 2003-05-17 12:37:25 by greenant
MameDir	 db "d:\mame\mame068b_i686\",0

MamePar db "d:\mame\mame068b_i686\mamepp.exe 19xx",0

xor eax, eax
mov sif.cb, sizeof STARTUPINFO
mov sif.lpReserved, eax
mov sif.lpDesktop, eax
mov sif.lpTitle, eax
mov sif.dwFlags, 0
mov sif.cbReserved2, 0
mov sif.lpReserved2, 0

invoke CreateProcess, 0, addr MamePar, NULL, NULL, FALSE, 0, NULL, addr MameDir, addr sif, addr pif
Posted on 2003-05-17 12:45:45 by comrade
Thanks, now it works.
But is there another way to do this keeping modulename and parameters in two differents string?
Posted on 2003-05-17 12:51:33 by greenant
greenant,

Try putting a space as the first character in you parameter:

MamePar db " 19xx",0

This worked for me!

HTH

farrier
Posted on 2003-05-17 15:14:11 by farrier