NWSMTSListTargetServices

Returns a list of all Target Services accessible through the connected TSA.

Syntax

  #include <smstsapi.h> 
  #include <smsutapi.h> 
   
  CCODE NWSMTSListTargetServices (
     UINT32              connection, 
     STRING              scanPattern, 
     NWSM_NAME_LIST **serviceNameList);
  

Parameters

connection

(IN) Specifies the connection information returned by NWSMConnectToTSA.

scanPattern

(IN) Specifies the Target Service names pattern to search for.

serviceNameList

(IN/OUT) Points to the list of Target Service names to be returned.

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

0xFFFEFFFE

NWSMDR_INVALID_PARAMETER

0xFFFEFFFD

NWSMDR_OUT_OF_MEMORY

0xFFFEFFFF

NWSMDR_INVALID_CONNECTION

Remarks

Before NWSMTSListTargetServices is called, the engine must be connected to a TSA.

If there are no names to return, NWSMTSListTargetServices returns successfully and serviceNameList is set to NULL.

The values that can be set for scanPattern is listed in the following table.

Value

Description

*smdrName.tsaName

Return all TSAs named tsaName on Target Services that have names that end with smdrName.

smdrName.tsaName*

Return all TSAs that begin with tsaName on Target Service smdrName.

*

Return all available TSAs.

*.*

Return all available TSAs.

NOTE:NWSMTSListTargetServices is implemented by calling NWSMTSScanTargetServiceName.

When connection is a handle to a TSA that services only one Target Service, NWSMTSListTargetServices returns a list of one entry.

HINT:The returned list does not describe the type of Target Service (such as NetWare or Linux). This additional information is returned by NWSMTSGetTargetServiceType.

See Also

NWSMTSConnectToTargetService, NWSMTSConnectToTargetServiceEx, NWSMTSGetTargetServiceType

Example

  #include <smstsapi.h>
  #include <smsdrapi.h>
  
  NWSM_NAME_LIST *serviceNameList = NULL;
  /* Connect to a TSA-see NWSMConnectToTSA. */
  /* Get a list of Target Services accessible through the connected TSA (some TSAs  can service multiple Target Services).
  NWSMTSListTargetServices or NWSMTSScanTargetServiceName can be used to create this list. */
  ccode = NWSMTSListTargetServices(connection, "*", &serviceNameList);
  /* See if we have more than one Target Service */
  if (serviceNameList->next)
  {
  /* Have the user choose a Target Service. */
  }
  /* Gather the optional information about the Target Service-see NWSMTSGetTargetServiceType. */
  /* Get the user’s name and password, and connect to the selected Target Services NWSMTSConnectToTargetService */