ResourceControl callback function

Performs an operation that applies to a resource. The PRESOURCE_CONTROL_ROUTINE type defines a pointer to this function.


DWORD WINAPI ResourceControl(
  _In_      RESID   Resource,
  _In_      DWORD   ControlCode,
  _In_opt_  PVOID   InBuffer,
  _In_      DWORD   InBufferSize,
  _Out_opt_ PVOID   OutBuffer,
  _In_      DWORD   OutBufferSize,
  _Out_     LPDWORD BytesReturned

    _In_      RESID   Resource,
    _In_      DWORD   ControlCode,
    _In_opt_  PVOID   InBuffer,
    _In_      DWORD   InBufferSize,
    _Out_opt_ PVOID   OutBuffer,
    _In_      DWORD   OutBufferSize,
    _Out_     LPDWORD BytesReturned


Resource [in]

Resource identifier of the affected resource.

ControlCode [in]

Control code that represents the operation to be performed. For a list of valid values for the ControlCode parameter, see Resource Type Control Codes.

InBuffer [in, optional]

Pointer to a buffer containing data to be used in the operation. InBuffer can be NULL if no data is required.

InBufferSize [in]

Size, in bytes, of the buffer pointed to by InBuffer.

OutBuffer [out, optional]

Pointer to a buffer containing data resulting from the operation. OutBuffer can be NULL if the operation does not need to return data.

OutBufferSize [in]

Size, in bytes, of the available space pointed to by OutBuffer.

BytesReturned [out]

Actual size, in bytes, of the data resulting from the operation.

Return value



The operation associated with ControlCode was completed successfully.



The resource DLL requested that the Resource Monitor perform default processing (if any) for ControlCode in addition to processing supplied by the DLL (if any).


234 (0xEA)

The allocated size of OutBuffer was too small to hold the requested data. BytesReturned indicates the required size. Always include the terminating NULL when calculating the byte sizes of strings.


5024 (0x13A0)

Indicates that new property values for a resource have been set in the cluster database, but the properties have not yet taken effect. The new property values will be applied after the resource is taken offline and brought online.

Error code

The operation was unsuccessful.


Some control codes should be handled by the resource DLL, while others should be left to the Resource Monitor. For effective implementation strategies of the ResourceControl entry-point function, see Implementing ResourceControl.


See Resource DLL Examples.


Minimum supported client

None supported

Minimum supported server

Windows Server 2008 Enterprise, Windows Server 2008 Datacenter



See also

Resource DLL Entry-Point Functions