init_process_policies() has this:
typedef BOOL (*SetProcessDEPPolicyHandler)(DWORD);
Surely the function must be WINAPI? According to:
http://msdn.microsoft.com/en-us/library/bb736299(v=vs.85).aspx
anyway. So, here is a patch. Besides I've rewritten the assignment and if-test:
--- SVN-Latest\wsutil\privileges.c Mon Feb 21 19:33:10 2011
+++ wsutil\privileges.c Wed Aug 17 17:25:16 2011
@@ -48,7 +48,7 @@
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 @@
*/
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);
}
}
--------
--gv