Changeset 73138 in webkit


Ignore:
Timestamp:
Dec 2, 2010 9:10:29 AM (13 years ago)
Author:
sfalken@apple.com
Message:

2010-12-02 Steve Falkenburg <sfalken@apple.com>

Reviewed by Adam Roben.

Enable DEP at runtime to allow for compatibility with older versions of ATL
https://bugs.webkit.org/show_bug.cgi?id=50378

  • WebProcess/win/WebProcessMainWin.cpp: (WebKit::enableDataExecutionPrevention): (WebKit::WebProcessMain):
  • win/WebKit2WebProcessCommon.vsprops:
Location:
trunk/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r73098 r73138  
     12010-12-02  Steve Falkenburg  <sfalken@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Enable DEP at runtime to allow for compatibility with older versions of ATL
     6        https://bugs.webkit.org/show_bug.cgi?id=50378
     7
     8        * WebProcess/win/WebProcessMainWin.cpp:
     9        (WebKit::enableDataExecutionPrevention):
     10        (WebKit::WebProcessMain):
     11        * win/WebKit2WebProcessCommon.vsprops:
     12
    1132010-12-01  Sam Weinig  <sam@webkit.org>
    214
  • trunk/WebKit2/WebProcess/win/WebProcessMainWin.cpp

    r68075 r73138  
    3737namespace WebKit {
    3838
     39static void enableDataExecutionPrevention()
     40{
     41    // Enable Data Execution prevention at runtime rather than via /NXCOMPAT
     42    // http://blogs.msdn.com/michael_howard/archive/2008/01/29/new-nx-apis-added-to-windows-vista-sp1-windows-xp-sp3-and-windows-server-2008.aspx
     43
     44    const DWORD enableDEP = 0x00000001;
     45
     46    HMODULE hMod = ::GetModuleHandleW(L"Kernel32.dll");
     47    if (!hMod)
     48        return;
     49
     50    typedef BOOL (WINAPI *PSETDEP)(DWORD);
     51
     52    PSETDEP procSet = reinterpret_cast<PSETDEP>(::GetProcAddress(hMod, "SetProcessDEPPolicy"));
     53    if (!procSet)
     54        return;
     55
     56    // Enable Data Execution Prevention, but allow ATL thunks (for compatibility with the version of ATL that ships with the Platform SDK).
     57    procSet(enableDEP);
     58}
     59
    3960#if USE(SAFARI_THEME)
    4061#ifdef DEBUG_ALL
     
    5980int WebProcessMain(const CommandLine& commandLine)
    6081{
     82    enableDataExecutionPrevention();
     83
    6184    ::OleInitialize(0);
    6285
  • trunk/WebKit2/win/WebKit2WebProcessCommon.vsprops

    r73060 r73138  
    1212                Name="VCLinkerTool"
    1313                AdditionalDependencies="WebKit$(WebKitDLLConfigSuffix).lib"
    14                 AdditionalOptions="/NXCOMPAT"
    1514        />
    1615</VisualStudioPropertySheet>
Note: See TracChangeset for help on using the changeset viewer.