Returns information about a primary resource.
#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);
(IN) Specifies the connection information returned by NWSMTSConnectToTargetService or NWSMTSConnectToTargetServicEx.
(IN) Specifies the resource name returned by NWSMTSScanTargetServiceResource or NWSMTSListTSResources.
(OUT) Points to the resource’s disk block size.
(OUT) Points to the total number of blocks on the resource.
(OUT) Points to the number of free blocks on the resource.
(OUT) Points to a flag indicating whether the resource is removable.
(OUT) Points to the total number of blocks set aside as purgeable blocks.
(OUT) Points to the number of blocks not marked to be purged.
(OUT) Points to the number of migrated sectors.
(OUT) Points to the number of sectors used by all data sets before they were compressed.
(OUT) Points to the number of sectors used by all compressed data sets.
See Section 9.3, Target Service Return Values for more information.
The following table lists the return values associated with the function.
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.
#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, ¬YetPurgeableBlocks, &migratedSectors, &precompressedSectors, &compressedSectors);