The Labs \ Source Viewer \ SSCLI \ System \ AccessViolationException

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. /*=============================================================================
  16. **
  17. ** Class: AccessViolationException
  18. **
  19. **
  20. ** Purpose: Exception class representing an AV that was deemed unsafe and may have corrupted the application.
  21. **
  22. **
  23. =============================================================================*/
  24. namespace System
  25. {
  26.    
  27.     using System;
  28.     using System.Runtime.Serialization;
  29.     [System.Runtime.InteropServices.ComVisible(true)]
  30.     [Serializable()]
  31.     public class AccessViolationException : SystemException
  32.     {
  33.         public AccessViolationException() : base(Environment.GetResourceString("Arg_AccessViolationException"))
  34.         {
  35.             SetErrorCode(__HResults.E_POINTER);
  36.         }
  37.        
  38.         public AccessViolationException(string message) : base(message)
  39.         {
  40.             SetErrorCode(__HResults.E_POINTER);
  41.         }
  42.        
  43.         public AccessViolationException(string message, Exception innerException) : base(message, innerException)
  44.         {
  45.             SetErrorCode(__HResults.E_POINTER);
  46.         }
  47.        
  48.         protected AccessViolationException(SerializationInfo info, StreamingContext context) : base(info, context)
  49.         {
  50.         }
  51.        
  52.         #pragma warning disable 169 // Field is not used from managed.
  53.         private IntPtr _ip;
  54.         // Address of faulting instruction.
  55.         private IntPtr _target;
  56.         // Address that could not be accessed.
  57.         private int _accessType;
  58.         // 0:read, 1:write
  59.         #pragma warning restore 169
  60.     }
  61.    
  62. }

Developer Fusion