#1 Burning Software

It is currently Thu Dec 19, 2024 4:04 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Reason to eject and load ...
PostPosted: Wed Aug 25, 2004 7:14 am 
Offline

Joined: Wed Aug 18, 2004 11:47 am
Posts: 12
Hi,

I am writing an app that needs to erase a rewritable disc, then following by writing data to the disc, then finally, verify the data that was written to the disc.

My question is ... is it really necessary to eject-and-load the disc between the erase and burn operations, and between the burn and verify operations ? Commercial apps like Nero always eject-and-load between operations, so I was wondering if there is a good reason to do so, that I may not be aware of ...

Chris


Top
 Profile  
 
 Post subject: Re: Reason to eject and load ...
PostPosted: Wed Aug 25, 2004 9:42 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Christian,

yes, in most of the cases this is really required. The drive would not refresh media state w/o load/unload sequence.

christan wrote:
Hi,

I am writing an app that needs to erase a rewritable disc, then following by writing data to the disc, then finally, verify the data that was written to the disc.

My question is ... is it really necessary to eject-and-load the disc between the erase and burn operations, and between the burn and verify operations ? Commercial apps like Nero always eject-and-load between operations, so I was wondering if there is a good reason to do so, that I may not be aware of ...

Chris


Top
 Profile  
 
 Post subject: ...
PostPosted: Fri Aug 27, 2004 8:57 pm 
Offline

Joined: Thu Jul 08, 2004 8:25 am
Posts: 51
Location: Germany
yes, that's right. But while I was reading the topic, I was wondering, if it could work with a simple "SHChangeNotify" with (for example) "SHCNE_MEDIAREMOVED" once and then with "SHCNE_MEDIAINSERTED" ?? I never tried :D , but if anyone does, please tell me, if it works.

another thing: most applications (like nero) ALWAYS eject, even after reading...so i've implemented a simple switch to eject after reading only if ReadDrive == WriteDrive (or does anybody here know a good reason to eject the source-disc after reading ??? (not really askin') )

Spin


Top
 Profile  
 
 Post subject: Re: ...
PostPosted: Fri Aug 27, 2004 9:18 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Not sure this would work. "Simulating" eject with start/stop unit w/o "eject" bit set could work but I'm too lazy (or better say "too busy") for such experiments :)

There are ABSOLUTELY no reasons to eject source reading disc. Nero and Alcohol doing so both drive me crazy :|

SpinDoctor wrote:
yes, that's right. But while I was reading the topic, I was wondering, if it could work with a simple "SHChangeNotify" with (for example) "SHCNE_MEDIAREMOVED" once and then with "SHCNE_MEDIAINSERTED" ?? I never tried :D , but if anyone does, please tell me, if it works.

another thing: most applications (like nero) ALWAYS eject, even after reading...so i've implemented a simple switch to eject after reading only if ReadDrive == WriteDrive (or does anybody here know a good reason to eject the source-disc after reading ??? (not really askin') )

Spin


Top
 Profile  
 
 Post subject: Re: ...
PostPosted: Sat Aug 28, 2004 1:00 pm 
Offline

Joined: Thu Jul 08, 2004 8:25 am
Posts: 51
Location: Germany
anton (staff) wrote:
...but I'm too lazy (or better say "too busy") for such experiments :)

just as me :D ...what's about you, Christian?

anton (staff) wrote:
There are ABSOLUTELY no reasons to eject source reading disc. Nero and Alcohol doing so both drive me crazy :|

just as me :D ... I think, people at nero, elby a.s.o. are great in writing system-stuff (just as you) but mostly have a poor (programmers) scope for UI...beside ejecting the read disc, there is also the possibility (elby's CloneCD) to select a read-drive ( say Drive N: ), select "copy on the fly" and when it comes to the "Select Destination" page, the source drive can be selected!! You have to click on "Burn Now" to hear, that you can't do that! Better: when selected "On The Fly", then the read-drive should not appear as destination drive, resp., if there is only one drive at all (reader/writer), then "On The Fly" should be disabled...
and so on...
I prefer marriages between system-components (written by experts) and GUI-Programmers ... and it's also very OK, if you concentrate on your business and don't touch things, that can be done by the application-programmers (e.g. disabling autorun or maybe people will ask you about CDDB-Support or other things...) stay the way you're on...it's the right way!

Spin


Top
 Profile  
 
 Post subject: Re: ...
PostPosted: Thu Sep 02, 2004 7:48 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Yes, this is the way we go :) That's why we're looking for the company to take care of UI and ActiveX samples for StarBurn SDK :)

SpinDoctor wrote:
anton (staff) wrote:
...but I'm too lazy (or better say "too busy") for such experiments :)

just as me :D ...what's about you, Christian?

anton (staff) wrote:
There are ABSOLUTELY no reasons to eject source reading disc. Nero and Alcohol doing so both drive me crazy :|

just as me :D ... I think, people at nero, elby a.s.o. are great in writing system-stuff (just as you) but mostly have a poor (programmers) scope for UI...beside ejecting the read disc, there is also the possibility (elby's CloneCD) to select a read-drive ( say Drive N: ), select "copy on the fly" and when it comes to the "Select Destination" page, the source drive can be selected!! You have to click on "Burn Now" to hear, that you can't do that! Better: when selected "On The Fly", then the read-drive should not appear as destination drive, resp., if there is only one drive at all (reader/writer), then "On The Fly" should be disabled...
and so on...
I prefer marriages between system-components (written by experts) and GUI-Programmers ... and it's also very OK, if you concentrate on your business and don't touch things, that can be done by the application-programmers (e.g. disabling autorun or maybe people will ask you about CDDB-Support or other things...) stay the way you're on...it's the right way!

Spin


Top
 Profile  
 
 Post subject: Re: ...
PostPosted: Fri Sep 30, 2005 9:50 am 
Offline

Joined: Tue Sep 27, 2005 8:58 am
Posts: 36
Location: UK
SpinDoctor wrote:
anton (staff) wrote:
...but I'm too lazy (or better say "too busy") for such experiments :)

just as me :D ...what's about you, Christian?


Did anyone run these experiments in the end!? Or was the laziness too great :wink:

I need to find a similar fix - ejecting/inserting is a last choice workaround....

Cheers,

Colin


Top
 Profile  
 
 Post subject: Re: ...
PostPosted: Fri Sep 30, 2005 11:46 am 
Offline

Joined: Tue Sep 27, 2005 8:58 am
Posts: 36
Location: UK
colin0117 wrote:

Did anyone run these experiments in the end!? Or was the laziness too great :wink:

I need to find a similar fix - ejecting/inserting is a last choice workaround....

Cheers,

Colin


OK, an update. I've tried device start/stop using the GenericExecute passthough function (I couldn't see an equivalent in the published StarBurn SDK).

The command executes fine, completes successfully but has no effect on Windows' knowledge of the volume information.

So, Windows is caching this information - and the cache only appears to be rechecked when the tray opens or closes. I think there's nothing that can be done with the StarBurn SDK that will resolve this (other than opening/closing the tray of course).

I'll keep checking to see if there's a Windows function to force a recheck of the volume information. If anyone else has done this before or has any knowledge on this subject, I'd be grateful if you could let me know.

Cheers,

Colin


Top
 Profile  
 
 Post subject: Re: ...
PostPosted: Fri Sep 30, 2005 2:13 pm 
Offline

Joined: Tue Sep 27, 2005 8:58 am
Posts: 36
Location: UK
FYI, the following code should do the trick. It forces Windows to dismount the device node. When the device is next accessed, it will get remounted automatically.

It works as expected on XP. The IO control has no comments for other OS restrictions so it should be available on other platforms.

// Open the device.
deviceHandle = CreateFile( "\\\\.\\e:",
GENERIC_READ|GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0,
NULL);
// Error getting the device handle for the drive
if ( deviceHandle == INVALID_HANDLE_VALUE )
{
printf( "didn't work on open (%d)\n", GetLastError() );
exit( 1 );
}

printf( "after open\n") ;

// Get the device address information.
if ( DeviceIoControl( deviceHandle,
FSCTL_DISMOUNT_VOLUME,
NULL,
0,
NULL,
0,
&dwBytes,
NULL ))
{
printf( "worked\n" );
}
else
{
printf( "failed (%d)\n", GetLastError() );
}


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 5:56 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
1) Windows keep polling thread for auto insert notification and gets special "media changed" status from the drive. So we can reset drive state but cannot make Windows re-mount the drive using hardware commands only.

2) You've sent code very close to what we send to people :) However a couple of calls (like locking the media) are missing. See, as you've already pointed it works for NT line of the OSes only so 100% universal way would be to eject the disc (95+ can be workarounded but I don't want to code another custom VxD - trying to forget how to do this).

Thank you very much for what you've did! :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 6:08 pm 
Offline

Joined: Tue Sep 27, 2005 8:58 am
Posts: 36
Location: UK
anton (staff) wrote:
1) Windows keep polling thread for auto insert notification and gets special "media changed" status from the drive. So we can reset drive state but cannot make Windows re-mount the drive using hardware commands only.


Yep, this is above your driver level, so 'not your problem' so to speak.

anton (staff) wrote:
2) You've sent code very close to what we send to people :) However a couple of calls (like locking the media) are missing. See, as you've already pointed it works for NT line of the OSes only so 100% universal way would be to eject the disc (95+ can be workarounded but I don't want to code another custom VxD - trying to forget how to do this).


I didn't lock intentionally. This code is the Windows media level. I'm using the StarBurn SDK for the lower level operations, such as lock the media, test for ready, that kind've stuff.

anton (staff) wrote:
Thank you very much for what you've did! :)


You're welcome. Where do I send the invoice!? :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 6:22 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
1) The most interesting part - we're now busy with the new source code for StarBurn (completely new) so need to maintain not only Windows, but also CE and Linux in the same codebase. Such a fun :)

2) Sure! president@whitehouse.gov :)

colin0117 wrote:
anton (staff) wrote:
1) Windows keep polling thread for auto insert notification and gets special "media changed" status from the drive. So we can reset drive state but cannot make Windows re-mount the drive using hardware commands only.


Yep, this is above your driver level, so 'not your problem' so to speak.

anton (staff) wrote:
2) You've sent code very close to what we send to people :) However a couple of calls (like locking the media) are missing. See, as you've already pointed it works for NT line of the OSes only so 100% universal way would be to eject the disc (95+ can be workarounded but I don't want to code another custom VxD - trying to forget how to do this).


I didn't lock intentionally. This code is the Windows media level. I'm using the StarBurn SDK for the lower level operations, such as lock the media, test for ready, that kind've stuff.

anton (staff) wrote:
Thank you very much for what you've did! :)


You're welcome. Where do I send the invoice!? :wink:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group