Export (0) Print
Expand All

ResUtilSetResourceServiceEnvironment function

Adjusts the environment data for a service so that the service uses a cluster network name to identify its location. This function must be called from a resource DLL. The PRESUTIL_SET_RESOURCE_SERVICE_ENVIRONMENT type defines a pointer to this function.

Syntax


DWORD WINAPI ResUtilSetResourceServiceEnvironment(
  _In_  LPCWSTR pszServiceName,
  _In_  HRESOURCE hResource,
  _In_  PLOG_EVENT_ROUTINE pfnLogEvent,
  _In_  RESOURCE_HANDLE hResourceHandle
);

typedef DWORD (WINAPI *PRESUTIL_SET_RESOURCE_SERVICE_ENVIRONMENT)(
    _In_  LPCWSTR pszServiceName,
    _In_  HRESOURCE hResource,
    _In_  PLOG_EVENT_ROUTINE pfnLogEvent,
    _In_  RESOURCE_HANDLE hResourceHandle
);

Parameters

pszServiceName [in]

Pointer a null-terminated Unicode string containing the name of the service.

hResource [in]

Resource handle for the service obtained from OpenClusterResource.

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

ResUtilSetResourceServiceEnvironment calls ResUtilGetEnvironmentWithNetName and stores the resulting environment block in a registry entry for the service. For more information about the effects of the environment block, see ResUtilGetEnvironmentWithNetName.

If your resource DLL manages a service, create a worker thread and use ResUtilSetResourceServiceStartParameters and ResUtilSetResourceServiceEnvironment when bringing the service online.

Do not call ResUtilSetResourceServiceEnvironment from any resource DLL entry point function. ResUtilSetResourceServiceEnvironment can safely be called from a worker thread. For more information, see Function Calls to Avoid in Resource DLLs.

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

ResUtilGetEnvironmentWithNetName

 

 

Show:
© 2014 Microsoft