Export (0) Print
Expand All

ResUtilSetResourceServiceStartParametersEx function

Adjusts the start parameters of a specified service so that it operates correctly as a cluster resource. It must be called from a resource DLL. The PRESUTIL_SET_RESOURCE_SERVICE_START_PARAMETERS_EX type defines a pointer to this function.

Syntax


DWORD WINAPI ResUtilSetResourceServiceStartParameters(
  _In_     LPCWSTR pszServiceName,
  _In_     SC_HANDLE schSCMHandle,
  _Inout_  LPSC_HANDLE phService,
  _In_     DWORD dwDesiredAccess,
  _In_     PLOG_EVENT_ROUTINE pfnLogEvent,
  _In_     RESOURCE_HANDLE hResourceHandle
);

typedef DWORD (WINAPI *PRESUTIL_SET_RESOURCE_SERVICE_START_PARAMETERS_EX)(
    _In_     LPCWSTR pszServiceName,
    _In_     SC_HANDLE schSCMHandle,
    _Inout_  LPSC_HANDLE phService,
    _In_     DWORD dwDesiredAccess,
    _In_     PLOG_EVENT_ROUTINE pfnLogEvent,
    _In_     RESOURCE_HANDLE hResourceHandle
);

Parameters

pszServiceName [in]

A pointer to a null-terminated Unicode string that specifies the name of the service.

schSCMHandle [in]

A handle to the Service Control Manager (SCM) or NULL. If NULL, the function attempts to open a handle to the SCM.

phService [in, out]

On input, a NULL service handle. On output, handle to the specified service if the call was successful; otherwise NULL.

dwDesiredAccess [in]

The requested access privileges. This might be any combination of GENERIC_READ (0x80000000), GENERIC_ALL (0x10000000), or MAXIMUM_ALLOWED (0x02000000). If this value is zero (0), an undefined error might be returned. Using GENERIC_ALL is the same as calling ResUtilSetResourceServiceStartParameters.

pfnLogEvent [in]

A pointer to the LogEvent entry point function of the resource DLL that manages the service.

hResourceHandle [in]

A resource handle that is required by the LogEvent entry point function. Use the handle that is passed to the DLL in the Open entry point function.

Return value

If the operation succeeds, the function returns ERROR_SUCCESS.

If the operation fails, the function returns a system error code.

Remarks

ResUtilSetResourceServiceStartParametersEx verifies that the service is not disabled, changes the service configuration to manual start, and prevents the service from restarting in response to failure. This enables the cluster and the resource DLL to control the service.

If your resource DLL manages a service, use ResUtilSetResourceServiceStartParametersEx and ResUtilSetResourceServiceEnvironment before you bring the service online.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2012

Header

ResApi.h

Library

ResUtils.lib

DLL

ResUtils.dll

See also

Service Utility Functions
ResUtilSetResourceServiceStartParameters

 

 

Show:
© 2015 Microsoft