NWSMTSGetTargetResourceInfo

Returns information about a primary resource.

Syntax

  #include <smstsapi.h> 
   
  CCODE NWSMTSGetTargetResourceInfo (
     UINT32      connection, 
     STRING      resourceName, 
     UINT16     *blockSize, 
     UINT32     *totalBlocks, 
     UINT32     *freeBlocks, 
     NWBOOLEAN  *resourceIsRemovable, 
     UINT32     *purgeableBlocks, 
     UINT32     *notYetPurgeableBlocks, 
     UINT32     *migratedSectors, 
     UINT32     *precompressedSectors, 
     UINT32     *compressedSectors);
  

Parameters

connection

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

resourceName

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

blockSize

(OUT) Points to the resource’s disk block size.

totalBlocks

(OUT) Points to the total number of blocks on the resource.

freeBlocks

(OUT) Points to the number of free blocks on the resource.

resourceIsRemovable

(OUT) Points to a flag indicating whether the resource is removable.

  • TRUE Resource is removable
  • FALSE Resource is not removable
purgeableBlocks

(OUT) Points to the total number of blocks set aside as purgeable blocks.

notYetPurgeableBlocks

(OUT) Points to the number of blocks not marked to be purged.

migratedSectors

(OUT) Points to the number of migrated sectors.

precompressedSectors

(OUT) Points to the number of sectors used by all data sets before they were compressed.

compressedSectors

(OUT) Points to the number of sectors used by all compressed data sets.

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

0xFFFDFFB9

NWSMTS_UNSUPPORTED_FUNCTION

0xFFFDFFD0

NWSMTS_NO_MORE_NAMES

0xFFFDFFDD

NWSMTS_INVALID_PARAMETER

0xFFFDFFE9

NWSMTS_GET_SERVER_INFO_ERR

0xFFFEFFFE

NWSMDR_INVALID_PARAMETER

0xFFFEFFFF

NWSMDR_INVALID_CONNECTION

Remarks

Before NWSMTSGetTargetResource is called, the engine must be connected to a TSA and Target Service.

NWSMTSGetTargetResource does not return information for all resources listed by NWSMTSScanTargetServiceResource or NWSMTSListTSResources. Only resources that return information by calling NWSMTSGetTargetResourceInfo can return information. NWSMTS_INVALID_PARAMETER is returned for resources that do not have any information.

The maximum block size value returned by blockSize is 32 KB. If the resource has a block size of 64 KB, blockSize returns zero.

See Also

NWSMTSListTSResources, NWSMTSScanTargetServiceResource, NWSMTSConnectToTargetServiceEx

Example

  #include <smsutapi.h> 
  #include <smstsapi.h> 
   
  char resourceName[NWSM_MAX_RESOURCE_LEN]; 
  UINT16 blockSize; 
  UINT32 totalBlocks, freeBlocks, purgeableBlocks, notYetPurgeableBlocks, migratedSectors, precompressedSectors,
  compressedSectors; NWBOOLEAN resourceIsRemovable; 
   
  /* select a resource name from the resource list and make the call */ 
  NWSMTSGetTargetResourceInfo(connection, (STRING)resourceName, &blockSize, 
        &totalBlocks, &freeBlocks, &resourceIsRemovable, &purgeableBlocks, 
        &notYetPurgeableBlocks, &migratedSectors, &precompressedSectors, 
        &compressedSectors);