Open callback function

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

Syntax


RESID WINAPI Open(
  _In_ LPCWSTR         ResourceName,
  _In_ HKEY            ResourceKey,
  _In_ RESOURCE_HANDLE ResourceHandle
);

typedef RESID (WINAPI *POPEN_ROUTINE)(
    _In_ LPCWSTR         ResourceName,
    _In_ HKEY            ResourceKey,
    _In_ RESOURCE_HANDLE ResourceHandle
);

Parameters

ResourceName [in]

Name of the resource to open.

ResourceKey [in]

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

ResourceHandle [in]

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

Header

ResApi.h

See also

Resource DLL Entry-Point Functions
LogEvent
SetResourceStatus

 

 

Show: