Returns the name space supported by a primary resource.
#include <smstsapi.h> CCODE NWSMTSListSupportedNameSpaces ( UINT32 connection, STRING resourceName, NWSM_NAME_LIST **supportedNameSpaces);
(IN) Specifies the connection information returned by NWSMTSConnectToTargetService or NWSMTSConnectToTargetServicEx.
(IN) Specifies a resource name returned by NWSMTSListTSResources or NWSMTSScanTargetServiceResource.
(OUT) Points to an allocated block of memory that contains a list of name spaces.
See Section 9.3, Target Service Return Values for more information.
The following table lists the return values associated with the function.
Before NWSMTSListSupportedNameSpaces is called, the engine must be connected to a TSA and Target Service.
NWSMTSListSupportedNameSpaces is a data requestor function. The first list element is the default name space of resourceName.
NOTE:NWSMTSListSupportedNameSpaces is implemented with NWSMTSScanSupportedNameSpaces.
/* This example queries the user for the resource that is to be selected for the session. */ #include <smstsapi.h> char *defaultNameSpaceName = NULL, *name; NWSM_NAME_LIST *nameList = NULL; UINT32 defaultNameSpaceType; /*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 NWSMScanTargetServiceResrouce 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. */ NWSMTSListSupportedNameSpaces(connection, nameList->name, &supportedNameSpaces); /* Get default name space */ if (supportedNameSpaces) { defaultNameSpaceType = *((UINT32 *)supportedNameSpaces->name); name = (char *)((UINT32 *)supportedNameSpaces->name + sizeof(UINT32)); defaultNameSpaceName = strdup(name); } }