hi guys, heres my problem, I have mucking about with CreateProcessA in a .exe I have compiled as loader.exe, thing is, if I pass args to loader.exe I then want it to pass those args on to the program I am starting with the CreateProcessA 1) what code do I need to I pick up args passed to my compiled loader.exe 2) then how do I pass those thru via CreateProcessA any assistance would be welcomed :) thanks! -Exocist
Posted on 2001-05-18 20:34:00 by Exocist
soz guyz, i should have taken a closer look at the masm32 library functions before I posted, I now have a 128 byte buffer allocated for the command line arguments and my code: invoke GetCL, 1, ADDR CLBuffer i have verified that the buffer is being filled with the commandline text but I need to pass that out in my CreateProcessA routine, I thought it was this but it isn't working: invoke CreateProcess,ADDR exename,ADDR CLBuffer,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,ADDR StartupInfo,ADDR ProcessInfo any help would be appreciated -Exocist
Posted on 2001-05-18 23:19:00 by Exocist
hi, Try adding the exename to the commandline before the switch it should work :). Try this example code: .data .. exename db "exename.exe ",0 ; take note of the space after the ; exename CLBuffer db 256 dup(0) buff db 256 dup(0) .code .. invoke GetCL, 1, CLBuffer invoke lstrcpy, ADDR buff, ADDR exename ; invoke lstrcat, ADDR buff, ADDR CLBuffer ; Exename /command invoke CreateProcess,ADDR exename,ADDR buff,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,ADDR StartupInfo,ADDR ProcessInfo happy coding, - clip
Posted on 2001-05-19 02:07:00 by clip