# cnfGetResourceList

Returns the list of resources defined in the system.

#### Prototype

DWORD cnfGetResourceList ( CTAHD ctahd, unsigned maxresources, unsigned *resourcelist, unsigned *numresources)

Argument | Description
ctahd | Natural Access handle returned by ctaCreateContext.
maxresources | Maximum number of entries in resourcelist array.
resourcelist | Pointer to an array of unsigned to receive the list of resource numbers. If NULL, this function returns the number of resources in numresources.
numresources | Pointer to the returned number of resources defined in the system.

#### Return values

Return value | Description
SUCCESS |
CTAERR_INVALID_CTAHD | ctahd is not a valid handle.

#### Details

cnfGetResourceList returns the actual list of resources defined in the system. To check for availability of a resource, open the resource. To determine the current number of resources without the actual number, set maxresources to 0 and resourcelist to NULL.

For more information, refer to Creating conferences.

#### See also

cnfCloseResource, cnfOpenResource

#### Example

unsigned printResourceList (CTAHD ctahd)
{
DWORD error;
unsigned resindex;
unsigned numresources = 0;
unsigned *resourcelist = NULL;
// First call just retrieves the number of conferencing resource
error= cnfGetResourceList(ctahd, 0, NULL, &numresources);
if (error != SUCCESS)
{
printf("Error when retrieving resource list :%d", error);
}
if (numresources)
{
if (resourcelist = malloc(numresources * sizeof(unsigned)))
{
// This call retrieves the whole list of conferencing resource
error= cnfGetResourceList(ctahd, numresources, resourcelist,
&numresources);
if (error != SUCCESS)
{
printf("Error when retrieving resource list :%d", error);
}
for (resindex = 0; resindex < numresources; resindex++)
printf("Conferencing resource %d exists",
resourcelist[resindex]);
free(resourcelist);
}
}
else
printf("No Conferencing resource detected using ctahd %x",
ctahd);
return (numresources);
}