GetProcessDEPPolicy function (winbase.h)

Gets the data execution prevention (DEP) and DEP-ATL thunk emulation settings for the specified 32-bit process.Windows XP with SP3:  Gets the DEP and DEP-ATL thunk emulation settings for the current process.


BOOL GetProcessDEPPolicy(
  [in]  HANDLE  hProcess,
  [out] LPDWORD lpFlags,
  [out] PBOOL   lpPermanent


[in] hProcess

A handle to the process. PROCESS_QUERY_INFORMATION privilege is required to get the DEP policy of a process.

Windows XP with SP3:  The hProcess parameter is ignored.

[out] lpFlags

A DWORD that receives one or more of the following flags.

Value Meaning
DEP is disabled for the specified process.
DEP is enabled for the specified process.
DEP-ATL thunk emulation is disabled for the specified process. For information about DEP-ATL thunk emulation, see SetProcessDEPPolicy.

[out] lpPermanent

TRUE if DEP is enabled or disabled permanently for the specified process; otherwise FALSE. If lpPermanent is TRUE, the current DEP setting persists for the life of the process and cannot be changed by calling SetProcessDEPPolicy.

Return value

If the function succeeds, it returns TRUE.

If the function fails, it returns FALSE. To retrieve error values defined for this function, call GetLastError.


GetProcessDEPPolicy is supported for 32-bit processes only. If this function is called on a 64-bit process, it fails with ERROR_NOT_SUPPORTED.

To compile an application that calls this function, define _WIN32_WINNT as 0x0600 or later. For more information, see Using the Windows Headers.


Minimum supported client Windows Vista with SP1, Windows XP with SP3 [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

Data Execution Prevention