The ResourceControl entry point function performs an operation that applies to a resource.
DWORD WINAPI ResourceControl(
RESID ResourceId,
DWORD ControlCode,
LPVOID InBuffer,
DWORD InBufferSize,
LPVOID OutBuffer,
DWORD OutBufferSize,
LPDWORD BytesReturned
);
If the operation was unsuccessful, ResourceControl returns a Win32 error value.
ResourceControl should be implemented by all resource DLLs. However, it is not necessary to provide code to handle all of the control codes that are defined for resources. As a minimum, you should support the following control codes that manipulate private properties:
Without support for CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTIES, you will not be able to set nonstring private properties on a newly created resource using the command-line tool CLUSTER.EXE. Without support for CLUSCTL_RESOURCE_SET_PRIVATE_PROPERTIES, you will not be able to validate the properties before setting them.
Without support for CLUSCTL_RESOURCE_VALIDATE_PRIVATE_PROPERTIES, Cluster Administrator will not be able to automatically validate your private properties before setting them.
If resources handled by your resource DLL have required dependencies, you must support CLUSCTL_RESOURCE_GET_REQUIRED_DEPENDENCIES.
If your resource DLL needs to replicate a portion of the system registry, you must support CLUSCTL_RESOURCE_GET_REGISTRY_CHECKPOINTS.
Support for any of the other control codes is optional. To determine how and why to support a particular control code, see its reference entry in the documentation. It is preferable not to provide support for some of the codes because they depend on the standard processing that the Resource Monitor supplies. In particular, do not include support for CLUSCTL_RESOURCE_GET_CHARACTERISTICS because it is important not to override the processing provided by the Resource Monitor.
To request that the Resource Monitor process a control code, return ERROR_INVALID_FUNCTION. You can return this value for a control code regardless of whether you include support for the code in ResourceControl. Some resource DLLs support a control code to augment the functionality that the Resource Monitor supplies.
If at all possible, make your implementation of ResourceControl finish in less than 300 milliseconds.
Version: Use Windows NT Server Enterprise Edition 4.0.
Windows CE: Unsupported.
Header: Declared in resapi.h.