DISKSTUF.DLL

This DLL is provided as a service to all VB users who may find it
useful.  If you choose to use this DLL then you do so *AT YOUR OWN
RISK*, however, I have been using it in all my VB3 apps with success.

There are two functions in this DLL that you can use with VBWIN. 
I will explain each separately:

*******************GetDriveSpace*************************************

1.  This function returns the free disk space of any valid drive.
It must be supplied three parameters, an integer (drive number), a 
double used to return the free disk space, and a double used
to return the disk size in kilobytes (KB).  Place the dll in
the Windows system directory.  The declaration is as follows (type 
full declaration on one line):

Declare Function GetDriveSpace% Lib "diskstuf.dll" Alias "#1" 
  (ByVal drive%, free#, total#)

Drive parameter:
  drive% =  0       'Current Drive
  drive% =  1       'Drive A:
  drive% =  2       'Drive B:
  drive% =  3       'Drive C:
  ...etc

Notice that there is no 'ByVal' used with free# or total#.

If the function is successful it will return True, otherwise False

Here is an example of calling the DLL:

Sub cmdDriveSpace_ Click()
  Dim drive%
  Dim free#
  Dim total#
  Dim ok%
  drive% = 0    'current drive
  ok% = GetDriveSpace(drive%, free#, total#)
  If ok% then
    ...code to use value returned by free# or total#
  Else
    ...what to do if function not successful
  End If
End Sub 

The variable 'free#' returns the amount of free disk space, the 
variable 'total#' returns the total amount of disk space on the 
drive.

*******************************GetVolInfo*******************************

2.  This function returns the VOLSTRUCT info for any valid drive.
It must be supplied two parameters, an integer (drive number) and a 
user defined type to hold the VOLSTRUCT information.  

This function calls an undocumented DOS FCB function.  This function is
valid for DOS version 4.0 to 6.2.  Before using this function with future
versions of DOS or Windows it is suggested you test it first.

Place the dll in the Windows system directory.  The declaration is as follows 
(type full declaration on one line):

Type VOLSTRUCT
  vlevel As Integer         'unknown as to its use
  vserial As Long           'returns drive serial number
  vlabel As String * 11     'returns drive volume label
  vfat As String * 8        'returns drive FAT bit value 
End Type

Declare Function GetVolInfo% Lib "diskstuf.dll" Alias "#3" 
  (ByVal drive%, vinfo As VOLSTRUCT)

Drive parameter:
  drive% =  0       'Current Drive
  drive% =  1       'Drive A:
  drive% =  2       'Drive B:
  drive% =  3       'Drive C:
  ...etc

If the function is successful it will return True, otherwise False.  
Ensure you check the return value of the function before you act on
the results

Here is an example of calling the DLL:

Sub cmdVolInfo_ Click()
  Dim drive%
  Dim volinfo As VOLSTRUCT
  Dim ok%
  drive% = 1    'Drive A:
  ok% = GetVolInfo(drive%, volinfo)
  If ok% then
    ...code to use volinfo, i.e
    myVolLabel$ = volinfo.vlabel
    myVolSerial$ = Hex$(volinfo.vserial)
  Else
    ...what to do if function not successful
  End If
End Sub 

This DLL is submitted by Douglas Marquardt, 72253,3113
