• <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 小明 閱讀(3293) 評論(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精品成人片牛牛影视| 久久精品中文无码资源站| 亚洲va久久久噜噜噜久久天堂| 中文字幕人妻色偷偷久久| 色噜噜狠狠先锋影音久久| 国产精品久久久久久久久软件| 2020久久精品国产免费| 伊人热热久久原色播放www| 99久久国产热无码精品免费久久久久| 青青热久久国产久精品 | 伊人久久综在合线亚洲2019| 亚洲日本久久久午夜精品| 久久夜色tv网站| 人妻精品久久无码专区精东影业| 久久er国产精品免费观看8| 久久国产高潮流白浆免费观看| 香蕉久久影院| 欧美激情精品久久久久久久| 国产一级做a爰片久久毛片| 性欧美大战久久久久久久久 | 亚洲中文字幕无码久久2017| 九九热久久免费视频| 久久99精品久久久久久| 99久久精品午夜一区二区 | 久久久久一区二区三区| 久久成人国产精品| 国产婷婷成人久久Av免费高清| 久久人人爽人人爽人人片AV麻烦| 久久久无码精品午夜| 青草久久久国产线免观| 色婷婷综合久久久久中文字幕| 久久亚洲国产精品123区| 四虎亚洲国产成人久久精品| 久久五月精品中文字幕| 怡红院日本一道日本久久 | 国产精品欧美久久久天天影视| 日日噜噜夜夜狠狠久久丁香五月| 亚洲国产另类久久久精品小说| 久久久久久毛片免费播放| 国内精品久久国产大陆|