device host: use a fresh job object per device host process (#40764)
* device host: use a fresh job object per device host process DeviceHostProxy assigned every device host process to a single shared kill-on-close job object. Because the system places each newly launched process in its own job, once the shared job had been assigned to one such process it could no longer accept a process belonging to an unrelated job, so subsequent AssignProcessToJobObject calls could fail with ERROR_ACCESS_DENIED and leave that device host process out of the kill-on-close job. Create a fresh kill-on-close job per device host process, keyed by process id, so each assignment targets an empty job and always succeeds. The jobs are held for the proxy's lifetime, so device host processes are still terminated when the VM shuts down. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * device host: simplify per-process job tracking to a vector RegisterDeviceHost is a one-time init callback per device host process, so the process-id keyed map and contains() dedup were unnecessary and introduced a pid-reuse hazard (a recycled pid could skip job assignment for a new process). Hold the per-process kill-on-close jobs in a plain vector instead. Each registration assigns its process to a fresh job; the jobs live for the proxy's lifetime so the device host processes are still terminated on VM shutdown. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>