Q:

Enabling DEP in Visual Studio

I've been lately doing some research about DEP , I compiled my code under Visual Studio with the Linker option /NXCOMPAT . When I run the executable under the debugger and dump the ntdll!_KPROCESS structure I get the following :
+0x096 Flags            : _KEXECUTE_OPTIONS
      +0x000 ExecuteDisable   : 0y0
      +0x000 ExecuteEnable    : 0y1
      +0x000 DisableThunkEmulation : 0y0
      +0x000 Permanent        : 0y1
      +0x000 ExecuteDispatchEnable : 0y0
      +0x000 ImageDispatchEnable : 0y0
      +0x000 DisableExceptionChainValidation : 0y1
      +0x000 Spare            : 0y1

Which indicate that DEP is disabled (ExecuteDisable == 0).
I'd like to add that Hardware DEP is enabled under my machine.

A:

Read about DEP in MSDN including system-wide settings and /NXCOMPAT linker option relating to a single app.  There might also be a BIOS setting relating to DEP.

