• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            小明思考

            高性能服務器端計算
            posts - 70, comments - 428, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            When program crashed (windows)

            Posted on 2008-11-17 13:54 小明 閱讀(3285) 評論(0)  編輯 收藏 引用 所屬分類: Win32Debug
            天下沒有不crash的程序。

            Crash作為一個客觀存在的現實,每個程序員都應該意識到這個問題,才能最大限度的降低crash所帶來的危害。

            讓我們先來看看幾種死亡對話框


            Figure-1 Crash MessageBox in Windows 2000


            Figure-2 Crash MessageBox in Windows XP

            讓我們看看哪些因素影響程序Crash的時候的行為

            1 . Error Mode

            --cut from microsoft--
            Each process has an associated error mode that indicates to the system how the application is going to respond to serious errors. Serious errors include disk failure, drive-not-ready errors, data misalignment, and unhandled exceptions. An application can let the system display a message box informing the user that an error has occurred, or it can handle the errors. To handle these errors without user intervention, use the SetErrorMode function. After calling SetErrorMode and specifying appropriate flags, the system will not display the corresponding error message boxes.
            --cut from microsoft--

            也就是說我們可以調用來SetErrorMode(SEM_NOGPFAULTERRORBOX)來屏蔽掉"Death MessageBox"的出現。

            具體的API使用參考http://msdn.microsoft.com/en-us/library/ms680621(VS.85).aspx

            另外值得一提的一點是,父子進程默認使用相同的ErrorMode,但是你可以在CreateProcess通過指定CREATE_DEFAULT_ERROR_MODE來disable.

            2.注冊表中的HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug

            有兩個key,第一個是auto,指定程序crash的時候要不要自動的load debugger
            如果為1,就不會顯示"Death MessageBox"而直接調用debugger了

            另外一個是debugger,指定默認的debugger.


            最后上傳一個測試程序來體會一下

            Click here to download TestCrash
            国产精品成人99久久久久91gav| 久久久久一本毛久久久| 欧美国产精品久久高清| 精品熟女少妇aⅴ免费久久| 久久久久亚洲爆乳少妇无| 精品久久久无码21p发布| 久久亚洲精品中文字幕| 精品久久久久久无码国产| 久久人妻少妇嫩草AV无码专区 | 国产精品乱码久久久久久软件| 国内精品久久久久久不卡影院| 激情综合色综合久久综合| 天堂无码久久综合东京热| 久久精品aⅴ无码中文字字幕重口| 久久99久久成人免费播放| 久久人人爽人人爽人人片AV东京热 | 久久久久无码精品| 亚洲日韩中文无码久久| 久久综合日本熟妇| 色综合合久久天天综合绕视看| 人人妻久久人人澡人人爽人人精品| 久久久久人妻一区精品色| 久久久久一级精品亚洲国产成人综合AV区 | 久久―日本道色综合久久| 久久婷婷色香五月综合激情| 99久久亚洲综合精品成人| 伊人久久大香线蕉综合影院首页| 久久精品亚洲福利| 久久天天躁狠狠躁夜夜躁2O2O | 色偷偷91久久综合噜噜噜噜| 久久久久久综合一区中文字幕| 亚洲精品乱码久久久久久蜜桃 | 久久久久亚洲av毛片大| 国产91色综合久久免费| 漂亮人妻被黑人久久精品| 久久精品国产日本波多野结衣| 久久亚洲中文字幕精品一区| 国产精品伦理久久久久久| 国产亚洲色婷婷久久99精品91| 亚洲嫩草影院久久精品| 久久99国产精品二区不卡|