I think that I found and fixed the problem.
There is a method COM addins have to implement to indicate weather or not it's
Ok for them to be unloaded. I totally forgot about that method as I've
implemented it years ago as part of the standard "stuff you have to implement
for COM".
This method used bad values to check if an unload is ok (which basically should
be never as long as we are not deactivated).
My current understanding is that the trigger here was that after exporting
contacts some internal cleanup code in Outlook checks if there are Addons that
are no longer needed and unloads them if they tell Outlook that this is Ok.
Which we dit. So Outlook unloaded us and any more calls to GpgOL crashed.
I could confirm with debug output that this was called right before GpgOL was
unloaded and we told Outlook that it's Ok to unload us.
This cleanup can probably happen under other circumstances, which would also
explain the random crashes you've seen before.
Thanks again for your patience and your excellent feedback in this issue which
made it possible to find and fix this.
The fix is:
A binary with the fix is:
There will be a gpg4win release with this Version soon.
Please let me know if you are still seeing crashes ;-) I could not reproduce any
more crashes with this version.