Need help!

I wanna develop a tool like tlist.exe of windows 2000 or tasklist.exe of
windows
2003.
tlist and tasklist commands show lists of processes.
An example of tlist -s is following.

696 lsass.exe Svcs: NtLmSsp,PolicyAgent,ProtectedStorage,SamSs
872 svchost.exe Svcs: RpcSs
920 svchost.exe Svcs: TermService
1148 svchost.exe Svcs: Dhcp,Dnscache
1172 svchost.exe Svcs: Alerter,LmHosts

According to the result, we can identify main role(RpcSs, TermService, etc)
of each svchost.exe process.
How can i get lists of services of each svchost.exe.

Thanks in advance!