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.

Syntax

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

Parameters

[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
0
DEP is disabled for the specified process.
PROCESS_DEP_ENABLE
0x00000001
DEP is enabled for the specified process.
PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION
0x00000002
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.

Remarks

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.

Requirements

Requirement Value
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

GetSystemDEPPolicy

SetProcessDEPPolicy