in windows server 2003. Does it assume that if it hasn't returned an error code, it must be running? or is there some kind of start code?
When it launches the process the scheduler receives a handle (reference) to that process which it can use to monitor it, pause, kill, etc.
When that handle is signalled it knows that the process has died for some reason and can then retrieve the final exit code.