Services and their dependencies are described in the Registry in HKLM / System / CurrentControlSet / Services / xxx, where xxx is the name of the service. There are hundreds of services, and only a few are visible in the Services.msc console. In the services console, you can open the properties window for the service and see the Dependencies tab. It will list the services that depend on the service, as well as the services on which the service depends. In the registry, each service has two optional keys named "DependOnService" and "DependOnGroup". Both are of type REG_MULTI_SZ, which means that they can contain multiple values. Use RegEdt32.exe when viewing these values. Dependencies are defined here. If you want your service to depend on Microsoft SQL Server, for example, in your service key, add a key called "DependOnService" containing "MSSQLSERVER". Check this by looking at the Dependencies tab of your service properties.
If you want to find service dependencies, you need to programmatically go through the Services key in the registry, specifying the services and services on which they depend. Once you have done this, you can simply print the results.
I wrote something similar to this when I wanted to find dependencies between .NET assemblies.
Iant8 source share