ResourceTypeControl

The ResourceTypeControl entry point function performs an operation that applies to a resource type.

DWORD WINAPI ResourceTypeControl(
  LPCWSTR ResourceTypeName,  
  DWORD ControlCode,     
  LPVOID InBuffer,       
  DWORD InBufferSize,    
  LPVOID OutBuffer,      
  DWORD OutBufferSize,   
  LPDWORD BytesReturned  
);
 

Parameters

ResourceTypeName
[in] Type of resource to be affected by the operation.
ControlCode
[in] Control code that represents the operation to be performed. For a list of all valid values for the ControlCode parameter, see Control Codes for Resource Types.
InBuffer
[in] Pointer to a buffer containing data to be used in the operation. InBuffer can be NULL if the operation does not require data.
InBufferSize
[in] Size, in bytes, of the buffer pointed to by InBuffer.
OutBuffer
[out] Pointer to a buffer containing data resulting from the operation. OutBuffer can be NULL if the operation returns no data.
OutBufferSize
[in] Size, in bytes, of the available space pointed to by OutBuffer.
BytesReturned
[out] Number of bytes in the buffer pointed to by OutBuffer that actually contain data.

Return Values

ERROR_SUCCESS
The operation indicated by ControlCode was completed successfully.
ERROR_INVALID_FUNCTION
The resource DLL may not support the operation represented by ControlCode. In some cases this is a signal to the Resource Monitor for it to process the request.

If the operation was unsuccessful, ResourceTypeControl should return a Win32 error value.

Notes to Implementers

ResourceTypeControl 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 resource types. As a minimum, you should support the following control codes that manipulate private properties:

If your resource type has required dependencies, you must support CLUSCTL_RESOURCE_TYPE_GET_REQUIRED_DEPENDENCIES.

If your resource type needs to replicate a portion of the system registry, you must support CLUSCTL_RESOURCE_TYPE_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_TYPE_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 ResourceTypeControl. Some resource DLLs support a control code to augment the functionality that the Resource Monitor supplies.

If at all possible, make your implementation of ResourceTypeControl finish in less than 300 milliseconds.

QuickInfo

  Version: Use Windows NT Server Enterprise Edition 4.0.
  Windows CE: Unsupported.
  Header: Declared in resapi.h.