title: Get the Description of a Service?
body: <p><strong>How may I get the description of a Windows Service like below?</strong></p>
  
  <p><img src="https://i.stack.imgur.com/tOReY.png" alt="enter image description here"></p>
  
  <p>I tried by using the Windows Registry, but the majority of Services appear to not have a description, or the description value is stored in a dll - so this seems to be the wrong approach.</p>
  
  <p>Example:</p>
  
  <p><strong>Windows Time Service</strong> (W32Time), the description in the registry is shown as </p>
  
  <blockquote>
    <p>@%SystemRoot%\system32\w32time.dll,-201</p>
  </blockquote>
  
  <p>Yet the actual description as seen in Services.msc is:</p>
  
  <blockquote>
    <p>Maintains date and time synchronization on all clients and servers in
    the network. If this service is stopped, date and time synchronization
    will be unavailable. If this service is disabled, any services that
    explicitly depend on it will fail to start.</p>
  </blockquote>
  
  <p>-</p>
  
  <p>I have been searching on the MSDN website and came across this:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms685156%28v=vs.85%29.aspx" rel="nofollow noreferrer">SERVICE_DESCRIPTION structure</a></p>
  
  <blockquote>
    <p><strong>lpDescription</strong></p>
    
    <p>The description of the service. If this member is NULL, the
    description remains unchanged. If this value is an empty string (""),
    the current description is deleted. </p>
    
    <p>The service description must not exceed the size of a registry value
    of type REG_SZ.</p>
    
    <p>This member can specify a localized string using the following format:</p>
    
    <p>@[path]dllname,-strID</p>
    
    <p>The string with identifier strID is loaded from dllname; the path is
    optional. For more information, see <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms724890%28v=vs.85%29.aspx" rel="nofollow noreferrer">RegLoadMUIString</a>....</p>
    
    <p>-</p>
    
    <p><strong>pszOutBuf [out, optional]</strong></p>
    
    <p>A pointer to a buffer that receives the string.</p>
    
    <p>Strings of the following form receive special handling:</p>
    
    <p>@[path]\dllname,-strID</p>
    
    <p>The string with identifier strID is loaded from dllname; the path is
    optional. If the pszDirectory parameter is not NULL, the directory is
    prepended to the path specified in the registry data. Note that
    dllname can contain environment variables to be expanded.</p>
  </blockquote>
  
  <p>Which I think would suggest why viewing the Registry showed the W32Time description as @%SystemRoot%\system32\w32time.dll,-201</p>
  
  <p>If I understand correctly I need to read the dll name in memory and retrieve the strID where the Service description is stored?</p>
  
  <p>This is all confusing for me, I would be grateful if someone could help. </p>
  
  <p>All I need is to get the description of a Service, it surely cannot be as complicated as this can it?</p>
  
  <p>Thanks :)</p>