NWSMTSReadDataSet

Reads a data set on the Target Service, formats the data according to SIDF, and returns it in a buffer.

Syntax

  #include <smstsapi.h> 
   
  CCODE NWSMTSReadDataSet (
     UINT32      connection, 
     UINT32      dataSetHandle, 
     UINT32      bytesToRead, 
     UINT32     *bytesRead, 
     BUFFERPTR   buffer);
  

Parameters

connection

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

dataSetHandle

(IN) Specifies the data set handle returned by NWSMTSOpenDataSetForBackup.

bytesToRead

(IN) Specifies the amount of free space in buffer.

bytesRead

(OUT) Points to the number of bytes read into buffer.

buffer

(OUT) Points to the buffer to contain the data (must be at least bytesToRead bytes large).

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

0xFFFDFFAF

NWSMTS_CLUSTER_TARGET_DOES_NOT_EXIST

0xFFFDFFB5

NWSMTS_WRITE_ERROR

0xFFFDFFB9

NWSMTS_UNSUPPORTED_FUNCTION

0xFFFDFFC6

NWSMTS_READ_ERROR

0xFFFDFFC9

NWSMTS_OUT_OF_MEMORY

0xFFFDFFE5

NWSMTS_INVALID_DATA_SET_HANDLE

0xFFFDFFE7

NWSMTS_INVALID_CONNECTION_HANDL

0xFFFDFFF9

NWSMTS_CREATE_ERROR

0xFFFDFFFF

NWSMTS_ACCESS_DENIED

0xFFFEFFFE

NWSMDR_INVALID_PARAMETER

0xFFFEFFFF

NWSMDR_INVALID_CONNECTION

Remarks

Before NWSMTSReadDataSet is called, NWSMTSScanDataSetBegin must be called to initiate the scan and NWSMTSOpenDataSetForBackup must be called to open the data set.

The data returned in buffer is the data mentioned in Standard ECMA-208. The engine formats the scan information and data set names (both are jointly known as data set information under SIDF) and places the result and data into a transfer buffer. Call NWSMSetNewRecordHeader and NWSMUpdateRecordHeader to put the information into the transfer buffer.

If buffer cannot contain all of the data, NWSMTSReadDataSet must be called repeatedly to retrieve all the data. bytesRead and bytesToRead indicates if all the data has been read. If bytesRead is equal to bytesToRead, there is more data to read.

See Also

NWSMTSCloseDataSet, NWSMTSScanNextDataSet

Example

See the example for NWSMTSScanDataSetBegin.