NWSMTSScanSupportedNameSpaces

Returns information about one name space that is supported by a primary resource.

Syntax

  #include <smstsapi.h> 
   
  CCODE NWSMTSScanSupportedNameSpaces (
     UINT32   connection, 
     UINT32  *sequence, 
     STRING   resourceName, 
     UINT32  *nameSpace, 
     STRING   nameSpaceName);
  

Parameters

connection

(IN) Specifies the connection information returned by NWSMTSConnectToTargetService or NWSMTSConnectToTargetServicEx.

sequence

(IN/OUT) Points to the sequence to use with the supported name spaces (set to zero initially).

resourceName

(IN) Specifies a resource name returned by NWSMTSListTSResources or NWSMTSScanTargetServiceResource.

nameSpace

(OUT) Points to a number that represents the name space.

nameSpaceName

(OUT) Specifies the name of the name space (NWSM_MAX_STRING_LEN bytes).

Return Values

See Section 9.3, Target Service Return Values for more information.

The following table lists the return values associated with the function.

0x00000000

Successful

0xFFFDFFB9

NWSMTS_UNSUPPORTED_FUNCTION

0xFFFDFFC5

NWSMTS_RESOURCE_NAME_NOT_FOUND

0xFFFDFFD0

NWSMTS_NO_MORE_NAMES

0xFFFDFFE4

NWSMTS_INVALID_DATA_SET_NAME

0xFFFDFFE7

NWSMTS_INVALID_CONNECTION_HANDL

0xFFFEFFFE

NWSMDR_INVALID_PARAMETER

0xFFFEFFFF

NWSMDR_INVALID_CONNECTION

Remarks

Before NWSMTSScanSupportedNameSpaces is called, the engine must be connected to a TSA and Target Service

See Also

NWSMTSListSupportedNameSpaces

Example

  /* 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); 
        }   
     } 
  }