NWSMTSListSupportedNameSpaces

Returns the name space supported by a primary resource.

Syntax

  #include <smstsapi.h> 
   
  CCODE NWSMTSListSupportedNameSpaces (
     UINT32              connection, 
     STRING              resourceName, 
     NWSM_NAME_LIST **supportedNameSpaces);
  

Parameters

connection

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

resourceName

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

supportedNameSpaces

(OUT) Points to an allocated block of memory that contains a list of name spaces.

Return Values

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

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

0xFFFDFFB9

NWSMTS_UNSUPPORTED_FUNCTION

0xFFFDFFC5

NWSMTS_RESOURCE_NAME_NOT_FOUND

0xFFFDFFC9

NWSMTS_OUT_OF_MEMORY

0xFFFDFFCE

NWSMTS_NO_SUCH_PROPERTY

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 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.

See Also

NWSMTSScanSupportedNameSpaces

Example

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