PDA

View Full Version : Data Execution Prevention


TwoSixTwo
06-25-2008, 11:26 AM
Some of our customers are currently experiencing a problem with Data Execution Prevention on Vista machines. I wanted to post it on this forum to see if anyone else has encountered the problem and how they've solved it. Also, the Kinook folks are pretty helpful. Perhaps they can help, too.

A brief summary: One of our build machines downloaded an update to framework 2.0. It builds several VS2005 projects. I believe the update included a piece that automatically marks executables and/or dll's with activex controls as 'no execute' which then causes an exception from DEP when the control is loaded. (The ActiveX control something from Crystal Reports.)

You can tell DEP that certain programs are excepted, however our executable can't be included in the exceptions list. Here's the message we get on a vista box when we try to add it: This program must run with data execution protection (DEP) enabled. You cannot turn off DEP for this program.

From one patch to the next our program files stopped working for customers.

I believe the problem and a solution is described here.

http://blogs.msdn.com/ed_maurer/archive/2007/12/14/nxcompat-and-the-c-compiler.aspx

Unfortunately the fix described is for C# while we use VB.Net.

I've also tried using the Application Compatibility Toolkit to set the DisableNX bit. I have a database but there's no clear instruction on how that would be deployed.

We can turn off DEP completely, but that's not acceptable.

Any thoughts/solutions would be appreciated.

Thanks,
Dave

PS
I tried emailing Ed Maurer, the blogger linked above, directly but got errors on the page.

kinook
06-25-2008, 12:04 PM
editbin.exe will work on VB.NET executables too. Build events in VS 2005 for VB.NET are configured as described here: http://forums.msdn.microsoft.com/en-US/vbgeneral/thread/bed23324-1f5d-4048-89d2-15aca77efa4d/

TwoSixTwo
06-25-2008, 01:35 PM
Very nice. Thanks for the link. I had tried editbin as a step in visual build pro but not as a post build event in the actual vb project.

You made a lot of folks happy. Again.