get_service_key_name


template <class character>
bool get_service_key_name(handle manager,
                          const character* display_name,
                          character* service_name,
                          unsigned* buffer)

This function obtains the (key) name of a service.

Parameters

handle manager

The handle to the service control manager.

const character* display_name

The display name of the service for which the key name is required.

character* service_name

A pointer to a buffer to hold the key name for the service.

unsigned* buffer

A pointer to a variable that holds the size (in characters) of the buffer pointed to by the previous parameter. Upon return from the function, the variable is set to contain the size (in characters) of the display name (excluding the null terminator). If the function fails because the buffer size is too small, the variable's value may be used to allocate a buffer of the required size.

Return

bool

true The function succeeded.
false The call failed.

Notes

The service key name is the name by which the service is known internally. This is the name stored as a registry key which service methods used to identify the service. The service display name is the externally displayed name for the service.

To perform the converse mapping (that is, from service key name to display name) the function get_service_display_name may be used.