LooksAlive

The LooksAlive entry point function determines if a resource appears to be available for use.

BOOL WINAPI LooksAlive(
  RESID ResourceId  
);
 

Parameters

ResourceId
[in] Resource identifier for the resource to poll.

Return Values

TRUE
The resource is probably online and available for use.
FALSE
The resource is not functioning properly.

Notes to Implementers

Unlike IsAlive, which determines whether a resource is in fact available for use, LooksAlive determines whether the resource appears to be available. LooksAlive should involve a cursory check that takes l50 milliseconds or less to complete if possible. At the very most, you should not allow LooksAlive to block processing for more than 300 milliseconds. However, if your implementation must take longer than 300 milliseconds:

  1. Have a separate thread dedicated to performing the polling operation.
  2. Return the result of the last poll performed by the separate thread.

If LooksAlive fails, the Resource Monitor will call your IsAlive entry point function to determine if the resource is indeed not functioning.

Call the Win32 function SetLastError just before returning.

Example

In Cluster Server's File Share resource DLL, LooksAlive uses the resource identifier in ResourceId as an index into a resource table that keeps track of all resources that are handled by the DLL. LooksAlive retrieves the address of the resource structure and then calls the IsAlive entry point to perform its check of the resource.

QuickInfo

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