Reference https://github.com/docker/docker/tree/master/daemon/execdriver/windows for porting the code.