Archive: rapi::CeCreateProcess


rapi::CeCreateProcess
Hi Please could anyone help me out here, I am needing to run the above command, and am unsure on how to create the necessary parameters for this to run from NSIS.
The only one that is really giving me any trouble is how the create the structure to hold the return information.

i.e.
LPPROCESS_INFORMATION lpProcessInformation

The doco states:
lpProcessInformation
[out] Long pointer to a PROCESS_INFORMATION structure that receives identification information about the new process.

Thanks for any help you can give.


Are you talking about this structure?

System::Call '*(i,i,i,i)i.R0'
This stores the structure in R0 and you can use it in the rapi call as i R0.So it would be
System::Call 'rapi::CeCreateProcess(w "C:\some_dir\myapp.exe",w "",,,,,,,,i R0)i.r9'
you can then pull things out of the structure to NSIS variables $1-$4 like this:
System::Call '*$R0(i.r0,i.r1,i.r2,i.r3)'
I am a bit puzzled by the long pointer reference, but I can't really test this. If the rapi call is unsuccesfull it should feed a zero to $9 so you can check it. To debug it and see what the error is, use this:
System::Call 'rapi::CeCreateProcess(w "C:\some_dir\myapp.exe",w "",,,,,,,,i R0)i.r9 ?e'
Pop $8
and look for the value of $8 (the error code) here
Hope this helps ...
CF