kolibrios-fun/programs/cmm/installer/tmp_add.c
Kirill Lipatov (Leency) 30f4695685 cmm: uploading all, part 1
git-svn-id: svn://kolibrios.org@3363 a494cfbc-eb01-0410-851d-a64ba20cac60
2013-03-11 18:16:24 +00:00

38 lines
794 B
C

struct ioctl_struct
{
dword handle;
dword io_code;
dword input;
dword inp_size;
dword output;
dword out_size;
};
struct add_disk_struc
{
dword DiskSize; // in sectors, 1 sector = 512 bytes. Include FAT service data
unsigned char DiskId; // from 0 to 9
};
ioctl_struct ioctl;
add_disk_struc add_disk;
int TmpDiskAdd(int disk_id, disk_size)
{
int driver_handle, driver_rezult;
driver_handle = LoadDriver("tmpdisk");
if (driver_handle==0) return 7;
add_disk.DiskId = disk_id;
add_disk.DiskSize = disk_size * 2048;
ioctl.handle = driver_handle;
ioctl.io_code = 1;
ioctl.input = #add_disk;
ioctl.inp_size = sizeof(add_disk);
ioctl.output = 0;
ioctl.out_size = 0;
driver_rezult = RuleDriver(#ioctl);
return driver_rezult;
}