>If a dot net app calls unmanaged code can that unmanaged code corrupt the
>dot net app. I'm thinking about a lang using pointers.
>
>If yes, are there any good debugging techniques to catch this?
Unmanaged code can certainly do harm. But the end result is usually
that you get an exception or the process is terminated, both are easy
to detect. Managed Debugging Assistants (MDAs) will alert you of
certain common errors.
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
cody - 19 May 2006 16:54 GMT
I think I know what he means. What is if a "wild" pointer overwrites data
which belongs to a .net object? Iam not sure wheather .NET will be able to
detect such things, how could it?
> >If a dot net app calls unmanaged code can that unmanaged code corrupt the
>>dot net app. I'm thinking about a lang using pointers.
[quoted text clipped - 7 lines]
>
> Mattias
Willy Denoyette [MVP] - 19 May 2006 21:06 GMT
You are right, it can't, it's very easy to corrupt the GC heap from
unmanaged code, and there is nothing the CLR can do about it. It's even
possible to corrupt the heap from managed code, simply use unsafe constructs
and let pointers go wild when writing stuff to the heap and watch your
process die in a nice crash.
Willy.
|I think I know what he means. What is if a "wild" pointer overwrites data
| which belongs to a .net object? Iam not sure wheather .NET will be able to
[quoted text clipped - 11 lines]
| >
| > Mattias