Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Development
Server Technologies
Windows Clustering
 ResourceControl callback function
ResourceControl callback function

Applies to: desktop apps only

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 2000 Server Advanced Server, Windows 2000 Server Datacenter

Header

ResApi.h

See also

Resource DLL Entry-Point Functions

 

 

Send comments about this topic to Microsoft

Build date: 3/14/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker