Offline

The Offline entry point function marks a resource as unavailable for use after cleanup processing is completed.

DWORD WINAPI Offline(
  RESID ResourceId  
);
 

Parameters

ResourceId
[in] Resource identifier for the resource to be taken offline.

Return Values

ERROR_SUCCESS
The request completed successfully and the resource is offline.
ERROR_IO_PENDING
The request is still pending and a thread has been activated to process the offline request.

If the operation was unsuccessful for other reasons, Offline should return a Win32 error value.

Remarks

If Offline returns a Win32 error value, the Resource Monitor logs an event and calls the Terminate entry point.

Notes to Implementers

Your implementation of Offline should take less than 300 milliseconds to complete. However, if it requires more than 300 milliseconds:

  1. Start a separate thread to complete the request.
  2. Return ERROR_IO_PENDING immediately.
  3. Make the thread that is processing the request periodically report status information to the Resource Monitor by calling the SetResourceStatus callback function. Keep calling SetResourceStatus until one of the following two situations occurs:

A time-out causes the Resource Monitor to call Terminate to abort the offline request. Make sure that all necessary cleanup operations have finished before you return from Offline.

Example

In Cluster Server's File Share resource DLL, Offline uses the resource identifier in ResourceId as an index into a resource table that keeps track of all resources handled by the DLL. Offline retrieves the address of the resource structure for the appropriate resource and uses the information in this resource structure to call the Win32 function NetShareDel to remove the share name from the server.

QuickInfo

  Version: Use Windows NT Server Enterprise Edition 4.0.
  Windows CE: Unsupported.
  Header: Declared in resapi.h.