I've got some code which does low level access to CD/DVD writers using SPTI.

That's all fine, except when something goes wrong (usually, sadly, the
result of my bugs :( ).

Then I'm left with a device which thinks it's busy and I can do nothing to
persuade it otherwise (save reboot the machine).

What I think I want to do is a device reset, but this seems not to be
supported, either as a SCSI command or an IOCTL.

How can I reset the device/subsystem so that I can gracefully back out of my
error condition and start to re-use the device?

(Sample code would be particularly nice)


Thanks

Iain

Re: Resetting a CD/DVD writer by Maxim

Maxim
Wed Mar 26 13:40:11 CDT 2008

Try disabling the device in Device Manager and enabling it back.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Iain" <Iain@discussions.microsoft.com> wrote in message
news:F403D1F5-01B0-4F7D-B0A0-D275DBDB2D82@microsoft.com...
> I've got some code which does low level access to CD/DVD writers using SPTI.
>
> That's all fine, except when something goes wrong (usually, sadly, the
> result of my bugs :( ).
>
> Then I'm left with a device which thinks it's busy and I can do nothing to
> persuade it otherwise (save reboot the machine).
>
> What I think I want to do is a device reset, but this seems not to be
> supported, either as a SCSI command or an IOCTL.
>
> How can I reset the device/subsystem so that I can gracefully back out of my
> error condition and start to re-use the device?
>
> (Sample code would be particularly nice)
>
>
> Thanks
>
> Iain


Re: Resetting a CD/DVD writer by Iain

Iain
Wed Mar 26 13:49:06 CDT 2008



"Maxim S. Shatskih" wrote:

> Try disabling the device in Device Manager and enabling it back.
>
That's an interesting idea, which I will try out.

My test CD is an external USB device so I've tried 'Safely Remove Hardware',
turning it off and restoring the power and the device.

This seems to work sometimes but not other times. When it doesn't work, I
need to reboot to get the thing going again.

Also, both these approaches are hard to implement in code. I'd like to be
able to recover from code errors gracefully ...

Thanks

Re: Resetting a CD/DVD writer by Maxim

Maxim
Wed Mar 26 13:56:15 CDT 2008

> Also, both these approaches are hard to implement in code. I'd like to be
> able to recover from code errors gracefully ...

It is possible to 100% debug the writer code, so this will not be an issue.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


Re: Resetting a CD/DVD writer by 440gtx

440gtx
Wed Mar 26 21:19:04 CDT 2008

> My test CD is an external USB device

Why are you powering down the machine when you can just unplug your
USB device instead?

> I'd like to be able to recover from code errors gracefully ...

Specify a timeout in your SPTI commands. When the command hangs the
timeout will be reached. Windows will then reset the device.