exclusion of shared data, ahh all that already gives me an headache.
Still waiting for answer to my question.
On Monday, October 26, 2009 8:23 PM Sanje?v wrote:
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 do not know...dirty? How have been applications using
plugins been doing all these years?
Here is 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 was not supposed to. If
plugin code referenced NULL pointers then access violation could be
caught without ambiguity.
-Sanjeev
On Wednesday, November 24, 2010 8:07 AM John Lim wrote:
Hi,
If I have two dlls. The first dll will call the exported functions of the second dll. In my first dll i have the following __try __except section
__try
{
if(CallFuncIn2ndDll(pBuffer))
{
dwDataReadCount = 8;
}
else
{
dwDataReadCount = (DWORD) -1;
}
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
SetLastError(ERROR_INVALID_PARAMETER);
return (DWORD) -1;
}
An exception (Access violation) happens in the function of the 2nd dll (which does not have a __try __except block) but my __try __except block does not catch this exception. Is this because the __try __except block can only catch excpetions within it own dll process space?
Thanks.
Regards,
John
On Wednesday, November 24, 2010 10:19 AM John Lim wrote:
Hi,
If I have two dlls. The first dll will call the exported functions of the second dll. In my first dll i have the following __try __except section
__try
{
if(CallFuncIn2ndDll(pBuffer))
{
dwDataReadCount = 8;
}
else
{
dwDataReadCount = (DWORD) -1;
}
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
SetLastError(ERROR_INVALID_PARAMETER);
return (DWORD) -1;
}
An exception (Access violation) happens in the function of the 2nd dll (which does not have a __try __except block) but my __try __except block does not catch this exception. Is this because the __try __except block can only catch excpetions within it own dll process space?
Thanks.
Regards,
John
Submitted via EggHeadCafe
C# In Depth Second Edition - An Interview with Jon Skeet
http://www.eggheadcafe.com/tutorials/aspnet/9961390d-2cc6-4a63-ab5e-dd8c1098e9f8/c-in-depth-second-edition--an-interview-with-jon-skeet.aspx