NWSMSetSessionHeaderInfo

Formats the session header information into an SIDF compliant session header.

Syntax

  #include <smsdefns.h> 
  #include <smsutapi.h> 
   
  CCODE NWSMSetSessionHeaderInfo ( 
     NWSM_SESSION_INFO  *sessionInfo, 
     BUFFERPTR             buffer, 
     UINT32                bufferSize, 
     UINT32               *headerSize);
  

Parameters

sessionInfo

(IN) Points to the session header information to be formatted.

buffer

(OUT) Points to the buffer to receive the formatted session information.

bufferSize

(IN) Specifies the size of buffer.

headerSize

(OUT) Points to the size of the formatted header.

Return Values

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

0x00000000

Successful

0xFFFBFFF0

NWSMUT_BUFFER_UNDERFLOW: An internal error occurred.

0xFFFBFFFA

NWSMUT_BUFFER_OVERFLOW

0xFFFBFFFD

NWSMUT_INVALID_PARAMETER: An internal error occurred.

Remarks

If you are using SMS DI, call NWSMSDOpenSessionForWriting to write the header out to the medium.

To get the SMDR name, call NWSMListSMDRs.

See Also

NWSMGetSessionHeaderInfo, NWSMListSMDRs

NWSMSetSessionHeaderInfo Example

  #include <smstsapi.h> 
  #include <smsutapi.h> 
  #include <smsdefns.h> 
   
  NWSM_SESSION_INFO sessionInfo; 
  NWSMSD_HEADER_BUFFER *sessionHeaderInfo; 
  UINT32 sessionDateTime; 
   
  /* Setup the session header buffer information. maxTransferBufferSize is set by NWSMSDSessionOpenForWriting */ 
  sessionHeaderInfo = (NWSMSD_HEADER_BUFFER *) malloc(sizeof(NWSMSD_HEADER_BUFFER) + maxTransferBufferSize - 1); 
  sessionHeaderInfo->bufferSize = maxTransferBufferSize; 
   
  /* Setup the session header information. */ 
  sessionDateTime = NWSMGetCurrentDateAndTime(); 
  NWSMDOSTimeToECMA(sessionDateTime, &(sessionInfo.timeStamp)); 
  strcpy(sessionInfo.description, “Backup file server”); 
  strcpy(sessionInfo.softwareName, “SBackup”); 
  strcpy(sessionInfo.softwareType, “SMS”); 
  strcpy(sessionInfo.softwareVersion, “Ver 4.x”); 
  sessionInof.serviceName = name from NWSMTSListTargetServices or NWSMTSScanTargetServices; 
  NWSMTSGetTargetServiceType(connection, (STRING)sessionInfo.sourceName, (STRING)sessionInfo.sourceType,
  (STRING)sessionInfo.sourceVersion); 
   
  /* Format the session information according to SIDF, and put the resulting data into the session header buffer. */ 
  NWSMSetSessionHeaderInfo(&sessionInfo, sessionHeaderInfo->headerBuffer, sessionHeaderInfo->bufferSize, 
  &sessionHeaderInfo->headerSize);