home *** CD-ROM | disk | FTP | other *** search
/ The Best of Mecomp Multimedia 2 / MECOMP-CD-II.iso / amiga / tools / system / format64 / source / 64bit.c next >
Encoding:
C/C++ Source or Header  |  1998-04-20  |  1.1 KB  |  38 lines

  1.  
  2. #include "exec/exec.h"
  3. #include "exec/nsd.h"
  4. #include "clib/exec_protos.h"
  5.  
  6. BOOL checkfor64bitcommandset(struct IOStdReq *io)
  7.     {
  8. //   struct IOStdReq io = { };
  9.     struct NSDeviceQueryResult nsdqr = { };
  10.     LONG error = 0;
  11.     BOOL newstyle = FALSE;
  12.     BOOL does64bit = FALSE;
  13.     UWORD *cmdcheck;
  14.  
  15.     nsdqr.SizeAvailable  = 0;
  16.     nsdqr.DevQueryFormat = 0;
  17.  
  18.     io->io_Command = NSCMD_DEVICEQUERY;
  19.     io->io_Length  = sizeof(nsdqr);
  20.     io->io_Data    = (APTR)&nsdqr;
  21.     error = DoIO((struct IORequest *)io);
  22.     if ((!error) && (io->io_Actual >= 16) &&
  23.         (nsdqr.SizeAvailable == io->io_Actual) &&
  24.         (nsdqr.DeviceType == NSDEVTYPE_TRACKDISK))
  25.         {
  26.         /* Ok, this must be a new style trackdisk device */
  27.         newstyle = TRUE;
  28.  
  29.         /* Is it safe to use 64 bits with this driver? We can reject */
  30.         /* bad mounts pretty easily via this check! */
  31.         for(cmdcheck = nsdqr.SupportedCommands; *cmdcheck; cmdcheck++)
  32.             if(*cmdcheck == NSCMD_TD_READ64)    does64bit = TRUE;
  33.                 /* This trackdisk style device supports the complete */
  34.                 /* 64 bit command set without returning IOERR_NOCMD! */
  35.         }
  36.     return(does64bit);
  37.     }
  38.