Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / May 2006

Tip: Looking for answers? Try searching our database.

Can unmanged code corrupt dot net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jrax - 16 May 2006 21:07 GMT
Hi,

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?

Thanx

jra
Mattias Sjögren - 16 May 2006 23:11 GMT
>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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.