Using OpenSCManager to load the Service Database of a non-running Windows installation
I am pulling (in the IT sense) hard drives from working machines and need to adjust their service configuration in the registry. In the Windows API OpenSCManager, which is used to edit services in the registry, has a sparsely documented lpDatabaseName parameter. Can I use that, say if a Working but not running Windows install is mounted as drive E:\? (the running Windows install is mounted on drive C:\)
Could I do e.g. OpenSCManager(NULL, "E:\Windows\WHAT_IS_THE_FILENAME", SC_MANAGER_ALL_ACCESS). Then use the handle to edit the service configuration on drive E:\? What is the file path for the second parameter? i.e. where would I find this service database file on drive E:\?
According to the SCM remote protocol specification, lpDatabaseName can only be NULL, "ServicesActive", or "ServicesFailed".