ResUtilSetResourceServiceStartParameters function
Adjusts the start parameters of a specified service so that it will operate correctly as a cluster resource. It must be called from a resource DLL. The PRESUTIL_SET_RESOURCE_SERVICE_START_PARAMETERS type defines a pointer to this function.
Syntax
DWORD WINAPI ResUtilSetResourceServiceStartParameters(
_In_ LPCWSTR pszServiceName,
_In_ SC_HANDLE schSCMHandle,
_Inout_ LPSC_HANDLE phService,
_In_ PLOG_EVENT_ROUTINE pfnLogEvent,
_In_ RESOURCE_HANDLE hResourceHandle
);
typedef DWORD (WINAPI *PRESUTIL_SET_RESOURCE_SERVICE_START_PARAMETERS)(
_In_ LPCWSTR pszServiceName,
_In_ SC_HANDLE schSCMHandle,
_Inout_ LPSC_HANDLE phService,
_In_ PLOG_EVENT_ROUTINE pfnLogEvent,
_In_ RESOURCE_HANDLE hResourceHandle
);
Parameters
- pszServiceName [in]
-
Pointer to a null-terminated Unicode string specifying the name of the service.
- schSCMHandle [in]
-
Handle to the Service Control Manager (SCM) or NULL. If NULL, the function will attempt 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.
- pfnLogEvent [in]
-
Pointer to the LogEvent entry point function of the resource DLL managing the service.
- hResourceHandle [in]
-
Resource handle required by the LogEvent entry point function. Use the handle 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
ResUtilSetResourceServiceStartParameters 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 allows the cluster and the resource DLL to control the service.
If your resource DLL manages a service, use ResUtilSetResourceServiceStartParameters and ResUtilSetResourceServiceEnvironment before bringing the service online.
Requirements
|
Minimum supported client |
None supported |
|---|---|
|
Minimum supported server |
Windows Server 2008 Enterprise, Windows Server 2008 Datacenter |
|
Header |
|
|
Library |
|
|
DLL |
|
See also