Returns information about one name space that is supported by a primary resource.
#include <smstsapi.h> CCODE NWSMTSScanSupportedNameSpaces ( UINT32 connection, UINT32 *sequence, STRING resourceName, UINT32 *nameSpace, STRING nameSpaceName);
(IN) Specifies the connection information returned by NWSMTSConnectToTargetService or NWSMTSConnectToTargetServicEx.
(IN/OUT) Points to the sequence to use with the supported name spaces (set to zero initially).
(IN) Specifies a resource name returned by NWSMTSListTSResources or NWSMTSScanTargetServiceResource.
(OUT) Points to a number that represents the name space.
(OUT) Specifies the name of the name space (NWSM_MAX_STRING_LEN bytes).
See Section 9.3, Target Service Return Values for more information.
The following table lists the return values associated with the function.
Before NWSMTSScanSupportedNameSpaces is called, the engine must be connected to a TSA and Target Service
/* This example queries the user for the resource that is to be selected for the session. */ defaultNameSpaceType = *((UINT32 *)supportedNameSpaces->name); name = (char *)((UINT32 *)supportedNameSpaces->name + sizeof(UINT32)); defaultNameSpaceName = (char *)malloc(strlen(name) + 1); strcpy(defaultNameSpaceName, name); #include <smstsapi.h> char *defaultNameSpaceName, resourceNameBuf[NWSM_MAX_RESOURCE_LEN], nameSpaceNameBuf[61]; /* Name space names no longer than 60 characters */ NWSM_NAME_LIST *nameList = NULL; UINT32 defaultNameSpaceType, sequence = 0, nameSpaceType, firstTime = TRUE; STRING resourceName = resourceNameBuf, nameSpaceName = nameSpaceNameBuf; /*Build a complete list of primary resources that are on the file server. */ NWSMTSListTSResources(connection, &nameList); /* If the resource name list is not empty, get the name spaces supported by the first resource. Remember that the first name returned by NWSMTSListTSResources or NWSMScanTargetServiceResource is always the resource that contains all other resources. Here, the first name is “FILE SERVER” */ if (nameList != NULL) { /* Build the name space list. Remember that the first name space is the default name space of the Target Service. */ while(NWSMTSScanSupportedNameSpaces(connection, &sequence, resourceName, &nameSpaceType, nameSpaceName) == 0) { if (firstTime) { /* Get default name space */ firstTime = FALSE; defaultNameSpaceType = nameSpaceType; defaultNameSpaceName = strdup(nameSpaceName); } } }