Re: Filtering 'Access Violation' error inside a try-catch block
With an in-process plugin system, it's definitely worth while to catch the
exception and report the list of loaded plugins (any of them could have
corrupted data structures). Don't count on recovery though (but do try to
save the user's data into a temp file, process it when your app restarts to
see if there's anything useful there).
"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:uJcZPcNTKHA.4408@TK2MSFTNGP06.phx.gbl...
The corruption happens in the data pages, not in code. You cannot protect
all your data with read-only.
You could write a set of routines to marshal the objectsback and forth.
Your own API proxy layer. To reduce copying, you can use shared memory.
You either do it right albeit tedious, or half-baked and essentially
not-working.
"Sanje?v" <swtbase@gmail.com> wrote in message
news:a51285c6-5dcd-43c2-a1db-d0adcc18c5d1@u16g2000pru.googlegroups.com...
I see what you mean. But as I said earlier copying data to and fro two
processes is tedious. I heavily use bitmap object and DCs between my
application and plugins. As HBITMAP and HDC are not usable across
processes, extracting bitmaps from HDCs, extracting and copying bitmap
header and bits into address space of plugin process and again doing
the same from the plugin process as a return bitmap from the function
in plugin is...I don't know...dirty? How have been applications using
plugins been doing all these years?
Here's another approach to the problem. If there was a way to protect
my application code with READ and EXECUTE only permissions before
entering plugin code, then my application could not be in inconsistent
state if plugin code tried to write where it wasn't supposed to. If
plugin code referenced NULL pointers then access violation could be
caught without ambiguity.
-Sanjeev
__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4512 (20091015) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4512 (20091015) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com