本文介绍了如果DEP处于活动状态,则迁移的应用程序将崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将MFC应用程序从vc6移植到了vc9(VS2008).一切都很好,但是如果DEP处于活动状态,程序将崩溃(下面的堆栈跟踪).我已经尝试过使用NX-Flag,但是没有任何变化.我还尝试使用Parasoft Insure ++构建应用程序,但没有显示内存损坏或任何其他问题.

I've ported our MFC application from vc6 to vc9 (VS2008). Everything's fine, but if DEP is active, program crashes (s. stacktrace below). I've already tried to play around with NX-Flag, but nothing changes. I also tried to build the application with Parasoft Insure++, but no memory corruptions or any other issues are shown.

预先感谢您的任何建议.

Thanks in advance for any advice.

环境如下所述:

  • DEP选项为NoExecute = OptOut,该程序位于排除列表中(如果没有,则不会崩溃,但是还有其他问题).
  • MFC MainFrame代码位于dll中,而不位于exe中
  • 如果DEP处于活动状态,则有一些旧的第三方ActiveX组件将不起作用

堆栈跟踪:

>   mfc90d.dll!CThemeHelper::IsAppThemed()  Zeile 82    C++
    mfc90d.dll!CControlBar::OnCreate(tagCREATESTRUCTA * lpcs=0x00dde2b4)  Zeile 576 + 0x5 Bytes C++
    mfc90d.dll!CWnd::OnWndMsg(unsigned int message=1, unsigned int wParam=0, long lParam=14541492, long * pResult=0x00dde05c)  Zeile 2014 + 0xd Bytes   C++
    mfc90d.dll!CWnd::WindowProc(unsigned int message=1, unsigned int wParam=0, long lParam=14541492)  Zeile 1755 + 0x20 Bytes   C++
    mfc90d.dll!CControlBar::WindowProc(unsigned int nMsg=1, unsigned int wParam=0, long lParam=14541492)  Zeile 506 + 0x14 Bytes    C++
    mfc90d.dll!AfxCallWndProc(CWnd * pWnd=0x01ba3d80, HWND__ * hWnd=0x000b1110, unsigned int nMsg=1, unsigned int wParam=0, long lParam=14541492)  Zeile 240 + 0x1c Bytes   C++
    mfc90d.dll!AfxWndProc(HWND__ * hWnd=0x000b1110, unsigned int nMsg=1, unsigned int wParam=0, long lParam=14541492)  Zeile 403    C++
    bedamain.dll!AfxWndProcDllStatic(HWND__ * hWnd=0x000b1110, unsigned int nMsg=1, unsigned int wParam=0, long lParam=14541492)  Zeile 54 + 0x15 Bytes C++
        ...
    user32.dll!7e37e34f()
    mfc90d.dll!CWnd::WindowProc(unsigned int message=1, unsigned int wParam=643120, long lParam=463138)  Zeile 1755 + 0x20 Bytes    C++
    mfc90d.dll!AfxGetModuleThreadState()  Zeile 498 + 0x11 Bytes    C++
    kernel32.dll!7c80a73d()
    mfc90d.dll!AfxDeactivateActCtx(unsigned long dwFlags=0, unsigned long ulCookie=495452227)  Zeile 260 + 0x17 Bytes   C++
    mfc90d.dll!AFX_MAINTAIN_STATE2::~AFX_MAINTAIN_STATE2()  Zeile 63 + 0xe Bytes    C++
    bedamain.dll!AfxWndProcDllStatic(HWND__ * hWnd=0x00071122, unsigned int nMsg=5, unsigned int wParam=0, long lParam=43648228)  Zeile 54 + 0x27 Bytes C++
        ...
    user32.dll!7e37c17e()
    mfc90d.dll!CWnd::DefWindowProcA(unsigned int nMsg=71, unsigned int wParam=48, long lParam=643672)  Zeile 1043 + 0x20 Bytes  C++
    mfc90d.dll!CWnd::WindowProc(unsigned int message=1, unsigned int wParam=14542916, long lParam=2024004508)  Zeile 1756 + 0x1c Bytes  C++
        ...
    user32.dll!7e37e4dc()
    mfc90d.dll!AfxCtxCreateWindowExA(unsigned long dwExStyle=512, const char * lpClassName=0x00067b58, const char * lpWindowName=0x78a44e50, unsigned long dwStyle=13565952, int X=-2147483648, int Y=-2147483648, int nWidth=-2147483648, int nHeight=-2147483648, HWND__ * hWndParent=0x00000000, HMENU__ * hMenu=0x028d090d, HINSTANCE__ * hInstance=0x10000000, void * lpParam=0x00ddf644)  Zeile 438 + 0xa3 Bytes  C++
    mfc90d.dll!CWnd::CreateEx(unsigned long dwExStyle=0, const char * lpszClassName=0x00067b58, const char * lpszWindowName=0x78a44e50, unsigned long dwStyle=13598720, int x=-2147483648, int y=-2147483648, int nWidth=-2147483648, int nHeight=-2147483648, HWND__ * hWndParent=0x00000000, HMENU__ * nIDorHMenu=0x028d090d, void * lpParam=0x00ddf644)  Zeile 708 + 0x35 Bytes  C++
    mfc90d.dll!CFrameWnd::Create(const char * lpszClassName=0x00067b58, const char * lpszWindowName=0x78a44e50, unsigned long dwStyle=13598720, const tagRECT & rect={...}, CWnd * pParentWnd=0x00000000, const char * lpszMenuName=0x000003ec, unsigned long dwExStyle=0, CCreateContext * pContext=0x00ddf644)  Zeile 608 + 0x54 Bytes    C++
    mfc90d.dll!CFrameWnd::LoadFrame(unsigned int nIDResource=1004, unsigned long dwDefaultStyle=13598720, CWnd * pParentWnd=0x00000000, CCreateContext * pContext=0x00ddf644)  Zeile 740 + 0x35 Bytes   C++
    mfc90d.dll!CDocTemplate::CreateNewFrame(CDocument * pDoc=0x01ba39c8, CFrameWnd * pOther=0x00000000)  Zeile 277 + 0x22 Bytes C++
    mfc90d.dll!CSingleDocTemplate::OpenDocumentFile(const char * lpszPathName=0x00000000, int bMakeVisible=1)  Zeile 125 + 0x13 Bytes   C++
    mfc90d.dll!CDocManager::OnFileNew()  Zeile 848  C++
    mfc90d.dll!CWinApp::OnFileNew()  Zeile 22   C++
    mfc90d.dll!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x10111a48, unsigned int nID=57600, int nCode=0, void (void)* pfn=0x100a5a18, void * pExtra=0x00000000, unsigned int nSig=57, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)  Zeile 82    C++
    mfc90d.dll!CCmdTarget::OnCmdMsg(unsigned int nID=57600, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)  Zeile 381 + 0x27 Bytes    C++
    mfc90d.dll!CWinApp::ProcessShellCommand(CCommandLineInfo & rCmdInfo={...})  Zeile 24 + 0x20 Bytes   C++
    bedamain.dll!CBeDaMainApp::InitInstance()  Zeile 261 + 0xc Bytes    C++
    bedamain.dll!InternalDllMain(HINSTANCE__ * hInstance=0x10000000, unsigned long dwReason=1, void * __formal=0x00ddfd30)  Zeile 100 + 0x13 Bytes  C++
    bedamain.dll!DllMain(HINSTANCE__ * hInstance=0x10000000, unsigned long dwReason=1, void * lpReserved=0x00ddfd30)  Zeile 272 C++
    bedamain.dll!__DllMainCRTStartup(void * hDllHandle=0x10000000, unsigned long dwReason=1, void * lpreserved=0x00ddfd30)  Zeile 546 + 0x11 Bytes  C
    bedamain.dll!_DllMainCRTStartup(void * hDllHandle=0x10000000, unsigned long dwReason=1, void * lpreserved=0x00ddfd30)  Zeile 510 + 0x11 Bytes   C
        ...
    ntdll.dll!7c928b7b()

推荐答案

看起来好像您的ActiveX组件正在堆栈上执行代码(因此DEP失败).

It looks like as if your ActiveX component is executing code on the stack (hence the DEP failure).

这篇关于如果DEP处于活动状态,则迁移的应用程序将崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 21:33