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
ERROR_SUCCESS
0
The operation was successful, and the resource is now online.
ERROR_RESOURCE_NOT_AVAILABLE
5006 (0x138E)
The resource was arbitrated with some other systems, and one of the other systems won the arbitration. Only quorum-capable resources return this value.
ERROR_IO_PENDING
997 (0x3E5)
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.
For effective implementation strategies of the Online entry-point function, see Implementing Online.

Examples

See Resource DLL Examples.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Target Platform Windows
Header resapi.h

See also

NetShareAdd

Resource DLL Entry-Point Functions