ResUtilEnumResources

The ResUtilEnumResources utility function enumerates all of the resources in a cluster and initiates an operation for each resource.

DWORD WINAPI ResUtilEnumResources(
  HRESOURCE hSelf,  
  LPCWSTR lpszResTypeName,  
  LPRESOURCE_CALLBACK pResCallBack,  
  PVOID pParameter  
);
 

Parameters

hSelf
[in] Optional handle to a resource that belongs to the cluster with the resources to enumerate.
lpszResTypeName
[in] Optional pointer to a name of a resource type narrowing the scope of resources to enumerate. If lpszResTypeName is specified, only resources of the specified type are enumerated.
pResCallBack
[in] Pointer to the ResourceCallback function to call for each resource, or for each resource that matches the filter described by lpszResTypeName.
pParameter
[in] Parameter to pass to the ResourceCallback function.

Return Values

ERROR_SUCCESS
The resources were successfully enumerated and subsequent calls to the resource callback functions were successful.
ERROR_NO_MORE_ITEMS
All of the resources have been enumerated.

If the operation was unsuccessful, ResUtilEnunResources can also return a Win32® error.

Notes to Callers

ResUtilEnumResources invokes the ResourceCallback function for every resource enumerated when hSelf is NULL. However, when hSelf is set to a valid resource handle, ResourceCallback is not invoked for the resource identified by hSelf. Additionally, if lpszResTypeName is specified, ResourceCallback will be called only for resources of the specified type.

ResourceCallback performs whatever tasks make sense for the resource. For example, Cluster Server's Print Spooler resource DLL checks that the group for the resource contains a single Print Spooler resource. It is a requirement for that resource type that there be only one Print Spooler resource per group.

ResUtilEnumResources opens the current cluster by calling OpenCluster and returns a resource enumeration handle by calling ClusterOpenEnum with the dwType parameter set to CLUSTER_ENUM_RESOURCE.

QuickInfo

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