NWSMConnectToTSA

Connects the backup engine to a TSA.

Syntax

  #include <smstsapi.h> 
   
  CCODE NWSMConnectToTSA (
     STRING   tsaName, 
     UINT32  *connection);
  

Parameters

tsaName

(IN) Specifies the name of the TSA to connect to returned by NWSMListTSAs.

connection

(OUT) Points to the connection information used for connecting to and getting information about the Target Service.

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

0xFFFEFFF5

NWSMDR_SMDR_CONNECT_FAILURE

0xFFFEFFF6

NWSMDR_NO_SUCH_SMDR

0xFFFEFFF7

NWSMDR_TSA_NOT_LOADED

0xFFFEFFDF

NWSMDR_UNKNOWN_ADDRESS

0xFFFEFFFD

NWSMDR_OUT_OF_MEMORY

0xFFFEFFFE

NWSMDR_INVALID_PARAMETER

0xFFFEFFF1

NWSMDR_NO_MORE_CONNECTIONS

0xFFFEFFE9

NWSMDR_INVALID_CONTEXT

Remarks

After connecting to the TSA, the engine can access only information about the Target Service. To get information about the target, see NWSMTSGetTargetServiceType. To access the target data, see NWSMTSConnectToTargetService.

An engine can have one or more concurrent connections to one or more TSAs. For each connection, the engine must call NWSMConnectToTSA once.

NOTE:The internal primary resource list is created when NWSMConnectToTSA is called.

See Also

NWSMTSConnectToTargetService, NWSMTSConnectToTargetServiceEx, NWSMTSListTargetServices, NWSMReleaseTSA

Example

  UINT32 connection; 
  STRING TSAName; 
   
  /* Find a TSA to connect to-see NWSMListTSAs. */ 
  NWSMConnectToTSA(TSAName, &connection); 
  /* Find a Target Service through the connected TSA-see NWSMTScanTargetServiceName and NWSMTSListTargetServiceName. */ 
  /* Connect to the target-see NWSMTSConnectToTargetService or NWSMTSConnectToTargetServiceEx . */