title: Is there a way to get the name of a Windows service from the process PID during SERVICE_START_PENDING?
body: <p>I am trying to dynamically get the name of a Windows service from it's process during startup (SERVICE_START_PENDING status) using the PID of the process, but every method I try doesn't seem to associate the service name and PID until the service moves to the SERVICE_RUNNING status.</p>
  <p>So far I have tried querying Win32_Services with WMI, executing &quot;tasklist /SVC&quot;, and calling EnumServicesStatusEx with P/Invoke. They all show that the PID of the service is 0, even though the service process has a real PID.</p>