Bug 479667 - Firefox should use SetProcessDEPPolicy (if available) to get DEP protection on Windows XPSP3 as well as Windows Vista if the global configuration has DEP off by default, p=bsmedberg r=jimm a=dveditz
git-svn-id: svn://10.0.0.236/trunk@258095 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
7c45662399
commit
2d5c16f9da
@ -107,6 +107,11 @@
|
|||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include "nsIWinAppHelper.h"
|
#include "nsIWinAppHelper.h"
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
#ifndef PROCESS_DEP_ENABLE
|
||||||
|
#define PROCESS_DEP_ENABLE 0x1
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "nsCRT.h"
|
#include "nsCRT.h"
|
||||||
@ -2432,9 +2437,27 @@ static void MOZ_gdk_display_close(GdkDisplay *display)
|
|||||||
*/
|
*/
|
||||||
PRBool nspr_use_zone_allocator = PR_FALSE;
|
PRBool nspr_use_zone_allocator = PR_FALSE;
|
||||||
|
|
||||||
|
#ifdef XP_WIN
|
||||||
|
typedef BOOL (WINAPI* SetProcessDEPPolicyFunc)(DWORD dwFlags);
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||||
{
|
{
|
||||||
|
#ifdef XP_WIN
|
||||||
|
/* On Windows XPSP3 and Windows Vista if DEP is configured off-by-default
|
||||||
|
we still want DEP protection: enable it explicitly and programmatically.
|
||||||
|
|
||||||
|
This function is not available on WinXPSP2 so we dynamically load it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll");
|
||||||
|
SetProcessDEPPolicyFunc _SetProcessDEPPolicy =
|
||||||
|
(SetProcessDEPPolicyFunc) GetProcAddress(kernel32, "SetProcessDEPPolicy");
|
||||||
|
if (_SetProcessDEPPolicy)
|
||||||
|
_SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
|
||||||
|
#endif
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
ArgResult ar;
|
ArgResult ar;
|
||||||
NS_TIMELINE_MARK("enter main");
|
NS_TIMELINE_MARK("enter main");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user