home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code2 / spc_time / dskfree.c next >
C/C++ Source or Header  |  1992-03-24  |  485b  |  28 lines

  1.  
  2. #include <windows.h>
  3. #include <dos.h>
  4.  
  5. int FAR PASCAL LibMain(HANDLE hModule, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine)
  6. {
  7.     return TRUE;
  8. }
  9.  
  10.  
  11.  
  12.  
  13.  
  14. long FAR PASCAL DSKFRE(int drv)
  15.  {
  16.    struct diskfree_t drive;
  17.   union longs {
  18.       unsigned long screw;
  19.       long screw2;
  20.       } it;
  21.  
  22.  
  23.    _dos_getdiskfree( drv,&drive );
  24.  
  25.    it.screw=(unsigned long) drive.bytes_per_sector*drive.sectors_per_cluster*drive.avail_clusters/1024;
  26.     return(it.screw2 );
  27. }
  28.