How does the OS break up command line arguments into an array?
I have a custom interpreter for an application that takes a hideously large number of arguments in complex combinations. I absolutely do not want to use the third-party solutions out there. I have a map set up that allows me to parse and generate these parameters.
While writing unit tests, I would like to take a generated string and split it exactly the way the OS does. I could launch a process with the generated string but I don't want to do that and pollute the unit tests.
Surely Windows must have a function it uses to do this before firing up the executable. I assume that's why we can simply pop the argument array reference off the stack in our entry point.