New patch:
http://jamesboston.ca/patches/patch111108.txt
After discussions with Benjamin Smedberg, Mark Finkle, Jason Orendorff, and Ted Mielczarek (among others) about Unicode, I've decided to decouple nsIProcess from the Netscape Portable Runtime, at least as far as process creation goes. I may still be able (need?) to use it for piping between processes. Benjamin brought home to me how long it would take to get Unicode support into the NSPR. Unfortunately, my approach to managing processes depends on the NSPR. So that approach is out. Unicode in the NSPR will have to be my next project.
Currently, nsIProcess only uses the NSPR to start non-Windows processes. It doesn't support Unicode at all. My plan is to port the Unix processes creation stuff over from the NSPR into nsIProcess.
I've gone back to an early patch I wrote to fix the kill method under Windows without using the NSPR, so that's back in. I've also merged code for Unicode support from an extension written by dafi:
http://dafizilla.wordpress.com/2008/10/08/nsiprocess-windows-and-unicode/
So with this patch Windows users at least can start and stop processes and use Unicode arguments. I've tested this with some Aramaic and it works.
The run method is now defined in xpidl to take wide characters like this:
[array, size_is(count)] in wstring args,
in unsigned long count);
In practice this translate to:
nsProcess::Run(PRBool blocking,
const PRUnichar **args,
PRUint32 count,
PRUint32 *pid)
The method that assembles the command line looks like this now:
PRUnichar **cmdLine)