• <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 小明 閱讀(3291) 評論(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
            久久久久黑人强伦姧人妻| 久久综合九色欧美综合狠狠| 久久伊人中文无码| 色婷婷久久久SWAG精品| 日本WV一本一道久久香蕉| 久久综合亚洲欧美成人| 国产一区二区三区久久| 久久久中文字幕日本| 久久人人爽人人爽人人爽 | 日韩精品久久久久久久电影蜜臀 | 久久精品一区二区三区AV| 99久久人妻无码精品系列| 久久久WWW成人免费精品| 久久狠狠高潮亚洲精品| 日日狠狠久久偷偷色综合免费| 狠狠综合久久AV一区二区三区| 欧美亚洲另类久久综合| 久久精品国产久精国产果冻传媒| 国产高清美女一级a毛片久久w| 无码人妻少妇久久中文字幕蜜桃| 久久99精品九九九久久婷婷| 久久久精品人妻一区二区三区蜜桃 | 久久久久久精品成人免费图片| 精品综合久久久久久97超人| 亚洲国产欧美国产综合久久| 婷婷久久综合九色综合绿巨人| 久久精品免费观看| 久久久久女人精品毛片| 人妻丰满AV无码久久不卡| 久久经典免费视频| 人妻无码久久精品| 色偷偷88欧美精品久久久| 久久免费国产精品| 手机看片久久高清国产日韩| 国产精品青草久久久久福利99| 久久免费美女视频| 伊人久久综在合线亚洲2019| 亚洲国产精久久久久久久| 亚洲国产精品人久久| 国产成人久久777777| 久久久WWW免费人成精品|