Startup callback function

Loads a resource DLL, returning a structure containing a function table and a version number. The PSTARTUP_ROUTINE type defines a pointer to this function.

Syntax


DWORD WINAPI Startup(
  _In_  LPCWSTR                      ResourceType,
  _In_  DWORD                        MinVersionSupported,
  _In_  DWORD                        MaxVersionSupported,
  _In_  PSET_RESOURCE_STATUS_ROUTINE SetResourceStatus,
  _In_  PLOG_EVENT_ROUTINE           LogEvent,
  _Out_ CLRES_FUNCTION_TABLE         *FunctionTable
);

typedef DWORD (WINAPI *PSTARTUP_ROUTINE)(
    _In_  LPCWSTR                      ResourceType,
    _In_  DWORD                        MinVersionSupported,
    _In_  DWORD                        MaxVersionSupported,
    _In_  PSET_RESOURCE_STATUS_ROUTINE SetResourceStatus,
    _In_  PLOG_EVENT_ROUTINE           LogEvent,
    _Out_ CLRES_FUNCTION_TABLE         *FunctionTable
);

Parameters

ResourceType [in]

Type of resource being started.

MinVersionSupported [in]

Minimum version of the Resource API supported by the Cluster service.

MaxVersionSupported [in]

Maximum version of the Resource API supported by the Cluster service.

SetResourceStatus [in]

Pointer to a callback function that the resource DLL should call to update its status after returning ERROR_IO_PENDING from Online or Offline. For more information see SetResourceStatus.

LogEvent [in]

Pointer to a callback function that the resource DLL should call to report events for the resource. For more information see LogEvent.

FunctionTable [out]

Pointer to a CLRES_FUNCTION_TABLE structure that describes the Resource API version and the specific names for the entry points.

Return value

ERROR_SUCCESS

0

The request was successful.

ERROR_REVISION_MISMATCH

1306 (0x51A)

The resource DLL does not support a version that falls in the range identified by the MinVersionSupported and MaxVersionSupported parameters.

If the operation was not successful, Startup should return one of the system error codes.

Remarks

The Startup entry-point function returns a function table that describes both the supported interface version of the Resource API and the entry points for all other functions required by the supported version of the Resource API.

At present, only Resource API version 1.0 is supported.

If your resource supports more than one version of the Resource API, return a function table for the latest version. The version number should be less than or equal to the MaxVersionSupported parameter. If the version of the function table pointed to by the FunctionTable parameter is not within range, your resource cannot be loaded successfully.

For more information see Implementing Startup.

Examples

See Implementing Startup.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 Enterprise, Windows Server 2008 Datacenter

Header

ResApi.h

See also

Resource DLL Entry-Point Functions

 

 

Show: