ResUtilEnumResourcesEx function (resapi.h)

Enumerates all of the resources in a specified cluster and initiates a user-defined operation for each resource. The PRESUTIL_ENUM_RESOURCES_EX type defines a pointer to this function.

Syntax

DWORD ResUtilEnumResourcesEx(
  [in]           HCLUSTER               hCluster,
  [in, optional] HRESOURCE              hSelf,
  [in]           LPCWSTR                lpszResTypeName,
  [in]           LPRESOURCE_CALLBACK_EX pResCallBack,
  [in]           PVOID                  pParameter
);

Parameters

[in] hCluster

A handle to the cluster that contains the resources to enumerate.

[in, optional] hSelf

An optional handle to a cluster resource. The callback function is not invoked for a resource that is identified by hSelf.

[in] lpszResTypeName

An optional pointer to a name of a resource type that narrows the scope of resources to enumerate. If lpszResTypeName is specified, only resources of the specified type are enumerated.

[in] pResCallBack

A pointer to a user-defined function that is called for each enumerated resource. This function must conform to the definition of the ResourceCallbackEx callback function. Note that parameter names are not part of the definition; they have been added here for clarity.

DWORD (*LPRESOURCE_CALLBACK_EX)( 
  HCLUSTER hCluster,
  HRESOURCE hSelf, 
  HRESOURCE hEnum, 
  PVOID pParameter 
);

hCluster

The hCluster parameter that is passed to ResUtilEnumResourcesEx.

hSelf

The hSelf parameter that is passed to ResUtilEnumResourcesEx. Note that the callback function is never called when hSelf and hEnum refer to the same resource.

hEnum

A handle to the resource that currently is being enumerated. ResUtilEnumResourcesEx opens and closes this handle automatically.

pParameter

A generic buffer that enables you to pass any kind of data to the callback function.

[in] pParameter

A generic buffer that enables you to pass any kind of data to the callback function. ResUtilEnumResourcesEx does not use this parameter at all; it merely passes the pointer to the callback function. Whether you can pass NULL for the parameter depends on how the callback function is implemented.

Return value

If the operation succeeds, the function returns ERROR_SUCCESS.

If the operation fails, the function immediately halts the enumeration and returns the value that is returned by the callback function.

Remarks

ResUtilEnumResourcesEx is a convenient and easy-to-use alternative to the ClusterResourceEnum function.

Examples

See the example for ResUtilEnumResources.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2008 Datacenter, Windows Server 2008 Enterprise
Target Platform Windows
Header resapi.h
Library ResUtils.lib
DLL ResUtils.dll

See also

ClusterResourceEnum

ResUtilEnumResources

ResourceCallbackEx