IMAPI query cancel doesn't work!

  • Thread starter Thread starter tonylc
  • Start date Start date
T

tonylc

Hey guys,
In my burn project, I have everything working except the
cancellation of the burn. I have it setup such that when the user
initiates a "cancel" the IDiscMasterProgressEvents handler will set the
argument to true as shown:

HRESULT STDMETHODCALLTYPE CDProgressEvents::QueryCancel(boolean
*pbCancel)
{
if (*m_cancel == true)
{
*pbCancel = true;
}
return S_OK;
}

However I can hear the drive still spinning and it finishes burning
every time. Is there a reason as to why this is?

Also on a side note
1) why is it that every time I release the DiscMasterProgressEvents
after ProgressUnAdvise it returns some junk value.
2) Every time I call IDiscMaster->Release() after a close() call it
returns S_FALSE?

Do I not need to make these two calls then? Or is it implied that the
UnAdvise and Close() calls will automatically release?

But mainly why is cancelling not working?

Thanks for any suggestions/comments!
Tony
 
Hey guys,
In my burn project, I have everything working except the
cancellation of the burn. I have it setup such that when the user
initiates a "cancel" the IDiscMasterProgressEvents handler will set the
argument to true as shown:

HRESULT STDMETHODCALLTYPE CDProgressEvents::QueryCancel(boolean
*pbCancel)
{
if (*m_cancel == true)
{
*pbCancel = true;
}
return S_OK;
}

However I can hear the drive still spinning and it finishes burning
every time. Is there a reason as to why this is?

Also on a side note
1) why is it that every time I release the DiscMasterProgressEvents
after ProgressUnAdvise it returns some junk value.
2) Every time I call IDiscMaster->Release() after a close() call it
returns S_FALSE?

Not sure I follow this. What is returning junk, and what is the junk?
IUnknown::Release doesn't return an HRESULT.
Do I not need to make these two calls then? Or is it implied that the
UnAdvise and Close() calls will automatically release?

I'd think that you do need the calls. ProgressUnadvise should only release
any additional holds the IDiscMaster has on the thing, and leave you the
responsibility for the final Release. I can't see why Close would do
anything with it after you've unadvised it, and nothing other than a defacto
unadvise if you've managed to leave the sink active.
But mainly why is cancelling not working?

Are you running XPSP2? Not sure if its the same thing, but according to the
author of ISORecorder, Alex Feinman...

http://isorecorder.alexfeinman.com/v2.htm

"Sometime around XPSP1 Microsoft has broken the cancel feature in their
engine. I've caught on it to late to submit it for fixing in SP2. Perhaps
SP3".
 
I am using XPSP2, and it seems that cancel is broken there as well.

On another note, these are the calls I made when I release all of the
IMAPI components. Some of the calls commented "might not be needed"
are the ones that don't return S_OK while all the other ones do.


hr = DiscMaster->ProgressUnadvise(uProgressID);
hr = DiscMasterProgressEvents->Release(); // might not be needed
hr = DiscRecorder->Release();
hr = DiscMaster->Close();
hr = DiscMaster->Release(); // might not be needed
hr = JolietDiscMaster->Release();

So the question is: Am I not releasing the components correctly? Or
are the calls simply just not necessary?

Thanks!
 
I am using XPSP2, and it seems that cancel is broken there as well.

Yeah, I think that's what Alex was saying -- that it first broke in SP1 and
persists in its broken state through SP2 and we'll have to wait and see if
SP3 will repair it. He implies that he reported it, but I can find no other
mention of it through MS or google.
On another note, these are the calls I made when I release all of the
IMAPI components. Some of the calls commented "might not be needed"
are the ones that don't return S_OK while all the other ones do.


hr = DiscMaster->ProgressUnadvise(uProgressID);
hr = DiscMasterProgressEvents->Release(); // might not be needed

Like I said, IUnknown::Release doesn't return an HRESULT, so looking for it
to return S_OK makes no sense.
 
Is release all that is necessary for clean up? Or do I have to do any
other deallocation?

thanks for all the help!
 
Is release all that is necessary for clean up? Or do I have to do any
other deallocation?

No sure what all you mean by clean up, but calling Release is all you can do
to relinquish your hold on the object reference, and fulfills your
obligation to the provider.
 
Back
Top