Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ResourceControl callback function

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

Syntax


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
);

typedef DWORD (WINAPI *PRESOURCE_CONTROL_ROUTINE)(
    _In_      RESID   Resource,
    _In_      DWORD   ControlCode,
    _In_opt_  PVOID   InBuffer,
    _In_      DWORD   InBufferSize,
    _Out_opt_ PVOID   OutBuffer,
    _In_      DWORD   OutBufferSize,
    _Out_     LPDWORD BytesReturned
);

Parameters

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

Return code/valueDescription
ERROR_SUCCESS
0

The operation associated with ControlCode was completed successfully.

ERROR_INVALID_FUNCTION
1

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).

ERROR_MORE_DATA
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.

ERROR_RESOURCE_PROPERTIES_STORED
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.

 

Remarks

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.

Examples

See Resource DLL Examples.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2003 Enterprise, Windows Server 2003 Datacenter

Header

ResApi.h

See also

Resource DLL Entry-Point Functions

 

 

Show:
© 2015 Microsoft