How to control DEP ? (Data Execution Prevention)

Hello all,

I’ve written a legacy driver that maps a DLL into a process, locates
an exported function in the DLL, and schedules a thread to execute
that function. Everything seemed to have been working great until
just recently when I started playing around with DEP
(http://en.wikipedia.org/wiki/Data_Execution_Prevention). Since I am
mapping my DLL into a data region, and executing code in this data
region, the DEP feature in Windows is now crashing my applications. I
get an access denied error.

Does anyone know of a way to get around this issue?

Thanks,
J