Service descriptions used to be easily read from the registry, but now I see many service descriptions are using string redirection, e.g. "@%SystemRoot%\System32\hidserv.dll, -102". I *think* I need to use DllCall to retrieve the service description from the specified .DLL? I have no idea how to go about doing this.
I have a utility that prepends the Service Description with the current startup and running state which makes troubleshooting service statuses (and new services) easy. But with the string redirection, it makes the result ugly:
(https://dl.dropboxusercontent.com/u/13871375/Winbatch/servicedescriptions.png)
Assuming by redirection you are referring to the %SystemRoot% environmental variable in the path, you don't need to use any DllCall calls. You can use the RegQueryExpSz function if the registry value is of type REG_EXPAND_SZ or you can perform a string replacement on the value yourself by using the Enviroment function to get the current value of SystemRoot and use StrReplace to perform the string replacement. Just remember to escape the percent ('%') character with 2 percent signs ('%%') in any string literals.
What kind of string value do you get when you use the Win32 Network Extender's wntSvcCfgGet() function with Request # 10 to retrieve the service description? Is it returning the proper description value that you'd expect to see, or is it returning the same redirection string that's stored in the registry?
That did the trick, wntSvcCfgGet(). Thank you!
Thanks Chuck.
you're welcome :)