示例#1
0
bool win32_spti_media_change (TCHAR driveletter, int insert)
{
	for (int i = 0; i < total_devices; i++) {
		struct dev_info_spti *di = &dev_info[i];
		if (di->drvletter == driveletter && di->mediainserted != insert) {
			write_log (_T("SPTI: media change %c %d\n"), dev_info[i].drvletter, insert);
			di->mediainserted = insert;
			int unitnum = getunitnum (di);
			if (unitnum >= 0) {
				update_device_info (unitnum);
				scsi_do_disk_change (unitnum, insert, NULL);
				filesys_do_disk_change (unitnum, insert != 0);
				blkdev_cd_change (unitnum, di->drvletter ? di->drvlettername : di->name);
				return true;
			}
		}
	}
	return false;
}
示例#2
0
bool win32_ioctl_media_change (TCHAR driveletter, int insert)
{
	for (int i = 0; i < total_devices; i++) {
		struct dev_info_ioctl *ciw = &ciw32[i];
		if (ciw->drvletter == driveletter && ciw->di.media_inserted != insert) {
			write_log (_T("IOCTL: media change %s %d\n"), ciw->drvlettername, insert);
			ciw->di.media_inserted = insert;
			int unitnum = getunitnum (ciw);
			if (unitnum >= 0) {
				update_device_info (unitnum);
				scsi_do_disk_change (unitnum, insert, NULL);
				filesys_do_disk_change (unitnum, insert != 0);
				blkdev_cd_change (unitnum, ciw->drvlettername);
				return true;
			}
		}
	}
	return false;
}