POPEN_ROUTINE callback function (resapi.h)

Opens a resource. The POPEN_ROUTINE type defines a pointer to this function.

Syntax

POPEN_ROUTINE PopenRoutine;

RESID PopenRoutine(
  LPCWSTR ResourceName,
  HKEY ResourceKey,
  RESOURCE_HANDLE ResourceHandle
)
{...}

Parameters

ResourceName

Name of the resource to open.

ResourceKey

Cluster database key for the cluster that includes the resource represented by ResourceName.

ResourceHandle

Handle to be passed to the SetResourceStatus callback function in the Startup entry-point function.

Return value

If the operation was successful, Open returns a resource identifier (RESID).

If the operation was not successful, Open returns NULL. Call SetLastError to specify that an error has occurred.

Remarks

The Open entry-point function opens a resource with the name identified by the ResourceName parameter and returns its resource identifier. The resource identifier can be used in future calls to other Resource API entry points to identify the resource.

Never close the handle represented by the ResourceHandle parameter or use it for any purpose other than passing it to the Resource Monitor through either the LogEvent callback function or the SetResourceStatus callback function.

For effective implementation strategies of the Open entry-point function, see Implementing Open.

Examples

See Resource DLL 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

LogEvent

Resource DLL Entry-Point Functions

SetResourceStatus