Customizing a Resource DLL
The resource DLL that is created by the Resource Type AppWizard contains implementations of all of the necessary entry point functions, but these implementations are very basic, providing only a basic failover and failback capability. There are three main reasons for customizing and enhancing the resource DLL source files that are generated by the AppWizard:
-
To create code that will allow your resources to take full advantage of the cluster environment. For example, when your resource is being taken offline it might be advantageous to close files that are open and delete files that are temporary.
-
To implement parameters or properties that provide information specific to your resources.
-
To support the Active/Active failover and failback capability, which enables two separate instances of your resource to run on different nodes using different data. The data resides on a disk on the shared SCSI bus.
The source files in your resource DLL project include comments that begin with TODO: to indicate where to insert additional functionality or ADDPARAM: to indicate where to insert additional parameters or properties. The following modifications are common:
-
Add library files specific to your resource type. Add lines for your resource-specific libraries after the following:
#pragma comment(lib, "clusapi.lib")
-
Add header files specific to your resource type. Add any header files that provide definitions and declarations specific to your resource type after these lines:
#include <clusapi.h>
#include <resapi.h>
#include <stdio.h>