VBA 6.5 causes Access Violation on Hardware DEP

Latest post 08-26-2009 4:20 PM by jimg. 8 replies.
  • 06-29-2009 12:40 PM

    VBA 6.5 causes Access Violation on Hardware DEP

    In a system with hardware DEP enabled, If booted with NoExecute=AlwaysOn, executing VBA codes causes Access Violation which is triggered by DEP. WinDBG showed SOFTWARE_NX_FAULT and attempting to execute non-executable address on heap. From call stack, it looks like that VBA allocates memory in heap and try to execute it. The Access Violation only happens on hardware DEP.

    This Access Violation can be easily reproduced with MS Excel 2007. However, if booted with NoExecute=OptOut, Excel 2007 will turn off DEP once a VBA project is opened.

    Are there any new interfaces or else in VBA 6.5 SDK which are needed to be implemented in order to upgrade VBA 6.3 to 6.5 to support permanent DEP? Or Does VBA 6.5 supports permanent DEP on hardware DEP?

  • 06-30-2009 5:03 PM In reply to

    • jimg
    • Top 10 Contributor
    • Joined on 04-05-2006
    • Posts 52

    Re: VBA 6.5 causes Access Violation on Hardware DEP

    Disable DEP on applications

    http://blogs.msdn.com/gauravb/archive/2008/09/23/disable-dep-on-applications.aspx

    How to make my program DEP-compatible

    http://stackoverflow.com/questions/350977/how-to-make-my-program-dep-compatible

    When DEP (Data Execution Prevention) is disbaled then everything works fine.

    You can disable DEP with the following command running in command line as administrator: bcdedit.exe /set {current} nx AlwaysOff

    Jim Grunden

  • 07-01-2009 9:43 AM In reply to

    Re: VBA 6.5 causes Access Violation on Hardware DEP

    Hi, Jim,

    Thanks for you reply.

    Disabling DEP will certainly make everything work fine. Because VBA 6.5 claims it supports DEP, we upgraded VBA 6.3 to 6.5 for our own application, so the application can run with DEP enabled. Actually, we want to run with permanent DEP. However, we found that executing any VBA codes caused Access Violation. And we also found that Excel behaved the exactly the same.

    So, the real question is that how much VBA 6.5 support DEP? Does it support permanent DEP on hardware DEP?

    Xingzhong Sun

  • 07-01-2009 1:25 PM In reply to

    • Gary
    • Top 10 Contributor
    • Joined on 07-13-2006
    • Posts 371

    Re: VBA 6.5 causes Access Violation on Hardware DEP

    We'll ask MSDN to clarify this isolated statement: (http://msdn.microsoft.com/en-us/isv/bb190541.aspx)

    "Support for Data Execution Prevention (DEP), also known as No Execute (NX) added to VBA."

    But we expect that this is incorrect, or at least mis-leading.  We would expect that VBA macros will not run with DEP enabled for your application or any application with DEP enabled.  When this is confirmed, we will ask Microsoft to remove this statement.

  • 07-01-2009 2:00 PM In reply to

    Re: VBA 6.5 causes Access Violation on Hardware DEP

    Hi, Gary,

    Thank you for your reply. That is very helpful.

    Hope Microsoft will give a clear answer.

    Xingzhong Sun

  • 07-07-2009 8:03 PM In reply to

    Re: VBA 6.5 causes Access Violation on Hardware DEP

    Does VBA itself attempt to disable DEP or must this handled by the hosting application?  If DEP must be disabled by the hosting application is it sufficient to set DEP policy to only disable DEP for ATL thunk emulation? (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)

    -bryan

    Filed under:
  • 07-08-2009 11:12 AM In reply to

    Re: VBA 6.5 causes Access Violation on Hardware DEP

    It looks like VBA itself attempts to disable DEP. However, we want our applications to run with DEP enabled because VBA 6.5 supports DEP as it is claimed.

    Any confirmation from Microsoft?

    Thanks,

    Xingzhong Sun

  • 08-24-2009 2:26 PM In reply to

    Re: VBA 6.5 causes Access Violation on Hardware DEP

    According to Microsoft, the DEP/NX support is actually a feature set for VBA7 and not a bug in VBA6. This version of VBA has  build 6.5.1543+, also known as “VBA 7”, and it will be included in Office14.

    Is there a redistribution package for this version of VBA from Summit? And When?

    Thanks,

    Xingzhong Sun

  • 08-26-2009 4:20 PM In reply to

    • jimg
    • Top 10 Contributor
    • Joined on 04-05-2006
    • Posts 52

    Re: VBA 6.5 causes Access Violation on Hardware DEP

    Currently, Microsoft is not planning to release "VBA 7"

    If you have any feedback or comments regarding this we will pass them on to Microsoft.

     

Page 1 of 1 (9 items) | RSS
Copyright Summit Software Company, 2008. All rights reserved.