question

NikitaProvotorov avatar image
0 Votes"
NikitaProvotorov asked RLWA32-6355 commented

(Jump lists) IApplicationDestinations::RemoveAllDestinations sometimes fails with strange error codes

Hey! I have something like the following code:

 CComPtr<IApplicationDestinations> rfHandle = nullptr;
    
 auto hr = rfHandle.CoCreateInstance(
     CLSID_ApplicationDestinations,
     nullptr,
     CLSCTX_INPROC_SERVER
 );
    
 if (hr != S_OK)
     /* throw exception */
    
 assert( (rfHandle!= nullptr) );
    
 hr = rfHandle->RemoveAllDestinations();
 if ( (hr != S_OK) &&
      // it is ok if no recent docs were registered before
      (hr != HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) )
     /* throw exception */

Sometimes on users machines rfHandle->RemoveAllDestinations() returns strange error codes e.g.:
- 0x80030021 (STG_E_LOCKVIOLATION);
- 0x80030020 (STG_E_SHAREVIOLATION);
- 0x80030100 (STG_E_INUSE);
- 0x80070020;
- 0x80070005.

I can't reproduce it and can't understand such errors in this context. Can you help me what should I look or do?

windows-api
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

According to the MSDN, these errors seem to be caused by the cleared items being occupied or busy.

0 Votes 0 ·

Thanks for the reply! But how Jump list's items can be "busy"?

0 Votes 0 ·

Can your users tell you what steps they are following that causes the issue to surface?

0 Votes 0 ·

They just open files via the application so it rewrites its Jump list's content via IApplicationDestinations::RemoveAllDestinations + SHAddToRecentDocs. Usual flows that usually work. I think the problem is in some specific environment but I can't ask users because the statistics are anonymous.


0 Votes 0 ·

Maybe its a race condition.

0 Votes 0 ·
Show more comments

0 Answers