Export (0) Print
Expand All

SetResourceStatus callback function

Called to update the status of a resource. The PSET_RESOURCE_STATUS_ROUTINE type defines a pointer to this function.

Syntax


DWORD WINAPI SetResourceStatus(
  _In_  RESOURCE_HANDLE ResourceHandle,
  _In_  PRESOURCE_STATUS ResourceStatus
);

typedef DWORD (WINAPI *PSET_RESOURCE_STATUS_ROUTINE)(
    _In_  RESOURCE_HANDLE ResourceHandle,
    _In_  PRESOURCE_STATUS ResourceStatus
);

Parameters

ResourceHandle [in]

Handle identifying the resource to be updated. The ResourceHandle parameter should contain the same handle used for the ResourceHandle parameter in the Open entry point for this resource.

ResourceStatus [in]

Pointer to a RESOURCE_STATUS structure that contains information about the resource's state.

Return value

SetResourceStatus returns one of the following values enumerated from the RESOURCE_EXIT_STATE enumeration.

Return code/valueDescription
ResourceExitStateContinue
0

The resource has not been terminated. Worker threads may continue Online and Offline operations for the resource.

ResourceExitStateTerminate
1

The resource has been terminated. Callers should end Online or Offline operations and immediately terminate all worker threads assigned to the resource.

 

Remarks

Resource DLLs call the SetResourceStatus callback function to update the status of a resource after their Online or Offline entry point function has returned ERROR_IO_PENDING. It should not be called at any other time. A pointer to the SetResourceStatus function is passed in the SetResourceStatus parameter to the resource's implementation of Startup.

SetResourceStatus is implemented by the Resource Monitor and is similar to the SetServiceStatus function.

Update the current state of a resource whenever necessary after you have returned ERROR_IO_PENDING. If the resource is in one of the pending states, increment the values for the CheckPoint and WaitHint members of the RESOURCE_STATUS structure and set the ResourceState member to ClusterResourceOnlinePending or ClusterResourceOfflinePending before you begin calling SetResourceStatus. Call SetResourceStatus until one of the following situations occurs:

  • The resource is placed in either the ClusterResourceOnline or ClusterResourceOffline state.
  • The time limit stored in the resource's PendingTimeout property has been exceeded.

There is no need to call SetResourceStatus to set the state of a resource to a pending state because the Resource Monitor automatically sets it to the appropriate pending state whenever Online or Offline returns ERROR_IO_PENDING.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2003 Enterprise, Windows Server 2003 Datacenter

Header

ResApi.h

See also

Resource DLL Callback Functions
Offline
Online
RESOURCE_STATUS
SetServiceStatus
Startup
Open
Terminate
ClusWorkerTerminate
RESOURCE_EXIT_STATE

 

 

Show:
© 2014 Microsoft