ResUtilStartResourceService function (resapi.h)

Starts a service. The PRESUTIL_START_RESOURCE_SERVICE type defines a pointer to this function.

Syntax

DWORD ResUtilStartResourceService(
  [in]  LPCWSTR     pszServiceName,
  [out] LPSC_HANDLE phServiceHandle
);

Parameters

[in] pszServiceName

Null-terminated Unicode string containing the name of the service to start.

[out] phServiceHandle

Optional pointer to a handle in which the handle to the started service is returned. This handle must be closed either by a call to the cluster utility function ResUtilStopService or the function CloseServiceHandle.

Return value

If the operation succeeds, the function returns ERROR_SUCCESS.

If the operation fails, the function returns a system error code. The following is a possible error code.

Return code Description
ERROR_SERVICE_NEVER_STARTED
The service was not started.

Remarks

The ResUtilStartResourceService utility function encapsulates the necessary calls to the service control manager, providing a convenient way to start services in the cluster. Using ResUtilStartResourceService is optional. If the service to be started requires specific access restrictions or other special handling, use the service control manager functions instead.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Target Platform Windows
Header resapi.h
Library ResUtils.lib
DLL ResUtils.dll

See also

ResUtilStopService