GetVolumeInformation

Returns information about a volume

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.x, 4.x, 5.x, 6.x
Platform:NLM
SMP Aware:No
Service:Volume

Syntax

   #include <nwdir.h> 
    
    int GetVolumeInformation (  
       WORD            fileServerID, 
       BYTE            volumeNumber, 
       int             structSize, 
       VOLUME_STATS   *volumeStatistics);
   

Parameters

fileServerID
(IN) 0 = Local server.
volumeNumber
(IN) Specifies the volume number to return information on.
structSize
(IN) Specifies the size (in bytes) of the information to return in volumeStatistics .
volumeStatistics
(OUT) Receives information about the specified volume.

Return Values

Decimal

Hex

Constant

0

(0x00)

ESUCCESS

152

(0x98)

ERR_INVALID_VOLUME

NetWare Error

UNSUCCESSFUL

Remarks

If structSize is less than the size of VOLUME_STATS, then only the first structSize bytes of VOLUME_STATS are returned.

The VOLUME_STATS structure, pointed to by the volumeStatistics parameter, has the following format:

      long   systemElapsedTime; 
      BYTE   volumeNumber;  
      BYTE   logicalDriveNumber; 
      WORD   sectorsPerBlock;  
      long   startingBlock;  
      WORD   totalBlocks;  
      WORD   availableBlocks;  
      WORD   totalDirectorySlots;  
      WORD   availableDirectorySlots;  
      WORD   maxDirectorySlotsUsed;  
      BYTE   isHashing;  
      BYTE   isRemovable;  
      BYTE   isMounted;  
      char   volumeName[17]; 
      LONG   purgableBlocks;  
      LONG   notYetPurgableBlocks;
   

IMPORTANT:With large volumes, the number of blocks to be returned in totalBlocks or availableBlocks may be greater than 64K, resulting in inaccurate field values because of limited field size. In such instances, use GetVolumeStatistics instead of this function.

The isRemovable field always returns true.

See Also

GetVolumeInfoWithNumber, GetVolumeName, GetVolumeNumber, GetVolumeStatistics

Example

   #include <stdlib.h> 
   #include <stdio.h>  
   #include <stddef.h> 
   #include <fcntl.h>  
   #include <nwshare.h> 
   #include <nwdir.h>  
   #include <nwbitops.h> 
   #include <nwtts.h>  
   #include <nwbindry.h> 
   #include <time.h>  
    
    main()  
    { 
    
       int            rc;  
       VOLUME_STATS   vs;  
       char 
              svn[10];  
       int            vn;  
    
       printf("volume number: ");  
       gets(svn);  
       vn = atoi(svn);  
       rc = GetVolumeInformation(0,vn,sizeof (vs), &vs);  
       
    if(rc)  
       {  
          printf("rc = %d\r\n",rc);  
          printf("errno = %d\r\n",errno);  
          printf("%s\r\n",strerror(errno)); 
    
       }  
       else  
       {  
          printf("systemElapsedTime = %d\r\n",vs.systemElapsedTime);  
          printf("volumeNumber = %d\r\n",vs.volumeNumber);  
          printf("logicalDriveNumber = %d\r\n",vs.logicalDriveNumber);  
          printf("sectorsPerBlock = %d\r\n",vs.sectorsPerBlock);  
          printf("startingBlock = %d\r\n",vs.startingBlock);  
          printf("totalBlocks = %d\r\n",vs.totalBlocks); 
    
          printf("availableBlocks = %d\r\n",vs.availableBlocks); 
    
          printf("totalDirectorySlots = %d\r\n",  
                  vs.totalDirectorySlots);  
          printf("availableDirectorySlots = %d\r\n",  
                  vs.availableDirectorySlots);  
    
          printf("maxDirectorySlotsUsed = %d\r\n", 
                  vs.maxDirectorySlotsUsed);  
          printf("isHashing = %d\r\n",vs.isHashing); 
    
          printf("isRemovable = %d\r\n",vs.isRemovable);  
    
          printf("isMounted = %d\r\n",vs.isMounted);  
          printf("volumeName = %s\r\n",vs.volumeName);  
       }  
    }