Question

I developed a program (in C# Winforms) and distributed it through a Google site I created.

I got a comment from someone that it doesn't work without the DEP disabled (he has Windows 7).

I read a little about the DEP thing and I understand that it blocks any program that tries to run with the RAM that suppose to save to the windows system...

Is this something I did when I developed the program? I made a setup project for the program so it creates a msi file. Is there is a way to prevent my program from running those forbidden pieces on the RAM (if i understand that correctly of course)?

the link to my site if it helps - https://sites.google.com/site/chessopeningmaster/

Was it helpful?

Solution

All .NET programs, at least since .NET 2.0 but possibly before, declare themselves DEP compatible. That's done by a flag in the header of the executable. You can see it when you run dumpbin.exe /headers on the EXE from the Visual Studio Command Prompt:

...
       2 subsystem (Windows GUI)
    8540 DLL characteristics
           Dynamic base
           NX compatible                       // <=== here
           No structured exception handler
           Terminal Server Aware
  100000 size of stack reserve
....

"NX" means Never eXecute, a data execution prevention mechanism implemented in hardware by the processor. The Wikipedia article about it is pretty good.

This is enforced by any modern version of Windows (XP SP2 and later) and any modern processor. You can safely assume that your program is in fact DEP compatible if it executes properly on your machine.

So this user probably saw your program crash, for whatever reason, and started tinkering with the tools available to him. Like turning DEP enforcement off. Technically it is possible that this stopped the crash. That however doesn't mean that the program is operating correctly. It is most certainly doesn't mean that you should turn this option off. Which is technically possible by running editbin.exe with the /nxcompat:no option.

If you want to pursue this then you should ask the user for a minidump of the crashed process.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top