PONLINE_ROUTINE callback function (resapi.h)
Marks a resource as available for use. The PONLINE_ROUTINE type defines a pointer to this function.
Syntax
PONLINE_ROUTINE PonlineRoutine;
DWORD PonlineRoutine(
[in] RESID Resource,
[in, out] LPHANDLE EventHandle
)
{...}
Parameters
[in] Resource
Resource identifier for the resource to be made available.
[in, out] EventHandle
On input, EventHandle is NULL. On output, EventHandle contains a handle to a nonsignaled synchronization object. The resource DLL can signal this handle at any time to report a resource failure to the Resource Monitor. EventHandle can also be set to NULL on output, indicating that the resource does not support asynchronous event notification.
Return value
Return code/value | Description |
---|---|
|
The operation was successful, and the resource is now online. |
|
The resource was arbitrated with some other systems, and one of the other systems won the arbitration. Only quorum-capable resources return this value. |
|
The request is pending, and a thread has been activated to process the online request. |
If the operation was not successful for other reasons, Online should return one of the system error codes.
Remarks
If the Online entry-point function returns an error code other than ERROR_IO_PENDING, the Resource Monitor logs an event and calls Terminate.
Returning a valid EventHandle yields the following benefits:
- The Resource Monitor will not perform LooksAlive polling. Avoiding this overhead is often useful, particularly when your DLL supports multiple resource instances.
- You can report resource failure at any time by signaling the handle. The Resource Monitor will immediately call IsAlive to verify that the resource has failed.
Examples
Requirements
Minimum supported client | None supported |
Minimum supported server | Windows Server 2008 Enterprise, Windows Server 2008 Datacenter |
Target Platform | Windows |
Header | resapi.h |
See also
Feedback
Submit and view feedback for