| 2371 | } |
| 2372 | |
| 2373 | static struct device_info *info_device (int unitnum, struct device_info *di, int quick, int session) |
| 2374 | { |
| 2375 | struct cdunit *cdu = &cdunits[unitnum]; |
| 2376 | memset (di, 0, sizeof (struct device_info)); |
| 2377 | if (!cdu->enabled) |
| 2378 | return NULL; |
| 2379 | di->open = cdu->open; |
| 2380 | di->removable = 1; |
| 2381 | di->bus = unitnum; |
| 2382 | di->target = 0; |
| 2383 | di->lun = 0; |
| 2384 | di->media_inserted = 0; |
| 2385 | di->bytespersector = 2048; |
| 2386 | di->mediapath[0] = 0; |
| 2387 | di->cylinders = 1; |
| 2388 | di->trackspercylinder = 1; |
| 2389 | di->sectorspertrack = (int)(cdu->cdsize / di->bytespersector); |
| 2390 | if (ismedia (unitnum, 1)) { |
| 2391 | di->media_inserted = 1; |
| 2392 | _tcscpy (di->mediapath, cdu->imgname_out); |
| 2393 | di->audio_playing = cdu->cdda_play > 0; |
| 2394 | } |
| 2395 | memset (&di->toc, 0, sizeof (struct cd_toc_head)); |
| 2396 | command_toc (unitnum, &di->toc); |
| 2397 | di->write_protected = 1; |
| 2398 | di->type = INQ_ROMD; |
| 2399 | di->unitnum = unitnum + 1; |
| 2400 | if (di->mediapath[0]) { |
| 2401 | _tcscpy (di->label, _T("IMG:")); |
| 2402 | _tcscat (di->label, di->mediapath); |
| 2403 | } else { |
| 2404 | _tcscpy (di->label, _T("IMG:<EMPTY>")); |
| 2405 | } |
| 2406 | _tcscpy (di->vendorid, _T("UAE")); |
| 2407 | _sntprintf (di->productid, sizeof di->productid, _T("SCSICD%d"), unitnum); |
| 2408 | _tcscpy (di->revision, _T("1.0")); |
| 2409 | di->backend = _T("IMAGE"); |
| 2410 | return di; |
| 2411 | } |
| 2412 | |
| 2413 | static void unload_image (struct cdunit *cdu) |
| 2414 | { |
nothing calls this directly
no test coverage detected