Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. struct ioctl_struct
  2. {
  3.         dword   handle;
  4.         dword   io_code;
  5.         dword   input;
  6.         dword   inp_size;
  7.         dword   output;
  8.         dword   out_size;
  9. };
  10.  
  11. struct add_disk_struc
  12. {
  13.         dword DiskSize; // in sectors, 1 sector = 512 bytes. Include FAT service data
  14.         unsigned char DiskId; // from 0 to 9
  15. };
  16.  
  17. ioctl_struct ioctl;
  18. add_disk_struc add_disk;
  19.  
  20. int TmpDiskAdd(int disk_id, disk_size)
  21. {
  22.         int driver_handle, driver_rezult;  
  23.         driver_handle = LoadDriver("tmpdisk");
  24.         if (driver_handle==0) return 7;
  25.        
  26.         add_disk.DiskId = disk_id;
  27.         add_disk.DiskSize = disk_size * 2048;
  28.  
  29.         ioctl.handle   = driver_handle;
  30.         ioctl.io_code  = 1;
  31.         ioctl.input    = #add_disk;
  32.         ioctl.inp_size = sizeof(add_disk);
  33.         ioctl.output   = 0;
  34.         ioctl.out_size = 0;
  35.        
  36.         driver_rezult = RuleDriver(#ioctl);
  37.         return driver_rezult;
  38. }