Export (0) Print
Expand All

ResUtilStartResourceService function

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

Syntax


DWORD WINAPI ResUtilStartResourceService(
  _In_   LPCWSTR pszServiceName,
  _Out_  LPSC_HANDLE phServiceHandle
);

typedef DWORD (WINAPI *PRESUTIL_START_RESOURCE_SERVICE)(
    _In_   LPCWSTR pszServiceName,
    _Out_  LPSC_HANDLE phServiceHandle
);

Parameters

pszServiceName [in]

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

phServiceHandle [out]

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 codeDescription
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

Minimum supported client

None supported

Minimum supported server

Windows Server 2003 Enterprise, Windows Server 2003 Datacenter

Header

ResApi.h

Library

ResUtils.lib

DLL

ResUtils.dll

See also

ResUtilStopService

 

 

Show:
© 2014 Microsoft