From Gisle Vanem: Make sure our SetProcessDEPPolicyHandler typedef

matches the documentation.

I also verified that DEP is still enabled on Win32 using Process Explorer.

svn path=/trunk/; revision=38583
This commit is contained in:
Gerald Combs 2011-08-17 16:47:04 +00:00
parent 0cd8dc13e0
commit 78d49fadf5
1 changed files with 3 additions and 2 deletions

View File

@ -48,7 +48,7 @@ void
init_process_policies(void)
{
HMODULE kernel32Handle;
typedef BOOL (*SetProcessDEPPolicyHandler)(DWORD);
typedef BOOL (WINAPI *SetProcessDEPPolicyHandler)(DWORD);
SetProcessDEPPolicyHandler PSetProcessDEPPolicy;
#ifndef PROCESS_DEP_ENABLE
@ -70,7 +70,8 @@ init_process_policies(void)
*/
kernel32Handle = GetModuleHandle(_T("kernel32.dll"));
if (kernel32Handle != NULL) {
if (PSetProcessDEPPolicy = (SetProcessDEPPolicyHandler) GetProcAddress(kernel32Handle, "SetProcessDEPPolicy")) {
PSetProcessDEPPolicy = (SetProcessDEPPolicyHandler) GetProcAddress(kernel32Handle, "SetProcessDEPPolicy");
if (PSetProcessDEPPolicy) {
PSetProcessDEPPolicy(PROCESS_DEP_ENABLE);
}
}