The Resource API entry point functions are implemented in a resource DLL to allow a Resource Monitor to manage its resources. Most of the entry point functions are required, but some are optional depending on the functionality provided by the resource. For example, the Arbitrate and Release entry point functions must be implemented for resources that can act as the cluster's quorum resource and must not be implemented for non-quorum capable resources.
The following table briefly describes the entry point functions in the Resource API.
Entry point function | Description |
---|---|
Arbitrate | Allows a node to attempt to regain ownership of a quorum resource. |
Close | Closes a resource. |
IsAlive | Determines if a resource is available for use. |
LooksAlive | Determines if a resource appears to be available for use. |
Offline | Marks a resource as unavailable for use after cleanup processing is completed. |
Online | Marks a resource as available for use. |
Open | Opens a resource. |
Release | Releases a quorum resource from arbitration. |
ResourceControl | Performs an operation that applies to a resource. |
ResourceTypeControl | Performs an operation that applies to a resource type. |
Startup | Loads a resource's resource DLL and returns a structure containing a function table and version number. |
Terminate | Marks a resource as unavailable for use without waiting for cleanup processing to finish. |
The function table returned by Startup contains pointers to each of the entry point functions. Startup is the only entry point function that is exported. The other entry point functions are accessed through the function table.
A resource DLL is non-reentrant for a given instance of a resource. That is, with one exception, resource DLL developers should expect each of their entry points to be called only once for each resource instance. The exception is Terminate. Calls to Terminate can occur at any time, even if other threads within the resource DLL are blocked waiting for an Online or Offline call to complete.
A resource DLL is reentrant with respect to resource identifiers, represented by the RESID data type. Resource identifiers are returned from the Open entry point function and supplied to all other entry points to identify a resource. Resource DLLs that handle multiple resource identifiers must be prepared to synchronize the use of any shared global data.