今天IE崩溃的时候,显示了一个带红叉的框,里面说:The exception previleged instruction 0xc0000096 occurred in the application... ...我想知道什么是"previleged instruction"? 是某一类api调用还是别的什么?

解决方案 »

  1.   

    Hi there
    Here i would like to explain both first chance exception and privileged instructions seprately.
    First - First chance exceptionStructured exception handling (SEH) takes a little getting used to, particularly when debugging. It is common practice to use SEH as a signaling mechanism. Some application programming interfaces (APIs) register an exception handler in anticipation of a failure condition that is expected to occur in a lower layer. When the exception occurs, the handler may correct or ignore the condition rather than allowing a failure to propagate up through intervening layers. This is very handy in complex environments such as networks where partial failures are expected and it is not desirable to fail an entire operation simply because one of several optional parts failed. In this case, the exception can be handled so that the application is not aware that an exception has occurred. However, if the application is being debugged, it is important to realize that the debugger will see all exceptions before the program does. This is the distinction between the first and second chance exception. The debugger gets the "first chance," hence the name. If the debugger continues the exception unhandled, the program will see the exception as usual. If the program does not handle the exception, the debugger will see it again (the "second chance"). In this latter case, the program normally would have crashed had the debugger not been present. 
    Now Privileged Instruction -Win32-based applications that call inp(), outp(), and so forth can be successfully compiled and linked. However, these applications will generate the privileged instruction exception because the port I/O functions cannot be called from code running in user mode. Do not call the following functions from within a Win32-based application executing in user mode: _inp()
    _inpw()
    _inpd()
    _outp()
    _outpw()
    _outpd() 
    I hope this answers your question.Savinder
      
    这是msdn上的解答  希望能帮到你
    http://www.codeguru.com/forum/archive/index.php/t-179565.html
      

  2.   

    不是楼上说的那样,所谓"previleged instruction"是指特权指令,也就是说是系统核心和某些驱动才能使用的指令,这是Intel 386保护模式的基本概念。
    Intel X86 CPU有4个特权级:ring0, ring1, ring2, ring3
    0级是最高级,3级是最低级,系统运行在0级,应用程序运行在3级,其他两级没有使用。
    特权指令只能在ring0级别使用,如果ring3级别的普通应用程序发出这些指令就会触发错误。楼上所说的几个C函数只会触发IOPL(输入输出特权级)。