Export (0) Print
Expand All

Online callback function

Marks a resource as available for use. The PONLINE_ROUTINE type defines a pointer to this function.

Syntax


DWORD WINAPI Online(
  _In_     RESID Resource,
  _Inout_  LPHANDLE EventHandle
);

typedef DWORD (*PONLINE_ROUTINE)(
    _In_     RESID Resource,
    _Inout_  LPHANDLE EventHandle
);

Parameters

Resource [in]

Resource identifier for the resource to be made available.

EventHandle [in, out]

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/valueDescription
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

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
NetShareAdd

 

 

Show:
© 2014 Microsoft