Search notes:

Registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services is the Service Control Manager (SCM) database.
This database is also known as the ServiceActive database.
A new entry in this database is created with CreateService().
Euch subkey under this key is the name of a driver and represents a service.

Relationship to %SystemRoot%\System32\drivers

Many services have a corresponding .sys file under %SystemRoot%\System32\drivers.
The following PowerShell scripts tries to find services that don't have a corresponding .sys file and .sys files that don't have a corresponding registry key.
#
#  1)   Iterate over each .sys file under %SystemRoot%\System32\drivers and
#       check if a respective key is found under HKLM\SYSTEM\CurrentControlSet\Services
#

$driverFiles = get-childItem "$env:SystemRoot\System32\drivers"
foreach ($driverFile in $driverFiles) {
#
# The type of $driverFile is FileInfo. Thus, it has the valuable
# property extension
#
  if ($driverFile.extension -eq '.sys') {

     $driverFileName = $driverFile.name
     $driverFileWithoutExtension = [io.path]::getFileNameWithoutExtension($driverFileName)

     $regKeyName = "HKLM:\SYSTEM\CurrentControlSet\Services\" + $driverFileWithoutExtension

     if (! (test-path -path $regKeyName)) {
        "not found key for  $driverFileName"
     }
     else {
        "    found key for  $driverFileName"
     }

  }
  else {
     "Not a .sys file: " + $driverFile.name
  }
}

#
#  2)  Iterate over each key in HKLM\SYSTEM\CurrentControlSet\Services and
#      check if there is a respective .sys file under %SystemRoot%\System32\drivers
#
$regKeys = get-childItem "HKLM:\SYSTEM\CurrentControlSet\Services" -name
foreach ($regKeyName in $regKeys) {
   if (test-path -path ("$env:SystemRoot\System32\drivers\" + $regKeyName + ".sys") ) {
     "    found .sys file for key  " + $regKeyName
   }
   else {
     "not found .sys file for key  " + $regKeyName
   }
}
Github repository about-Windows-Registry, path: /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/compare-services-and-sys-drivers.ps1

See also

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
driverquery.exe is a command line tool (cmd.exe, PowerShell) that seems to enumerate the keys under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.

Index