home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / vererror.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  3.8 KB  |  115 lines

  1. /**************************************************************************************
  2.  **                                                                                  **
  3.  ** Vererror.h - definitions of data structures, needed to report verifier errors.   **
  4.  **                                                                                  **
  5.  ** Copyright (c) 1996-2000 Microsoft Corporation.  All Rights Reserved.             **
  6.  **                                                                                  **
  7.  **************************************************************************************/
  8.  
  9.  
  10. #pragma once
  11.  
  12. #ifndef _VER_RAW_STRUCT_FOR_IDL_
  13. #include "CorHdr.h"
  14. #include "OpEnum.h"
  15. #include "CorError.h"
  16.  
  17.  
  18. // Set these flags if the error info fields are valid.
  19.  
  20. #define VER_ERR_FATAL        0x80000000L    // Cannot Continue
  21. #define VER_ERR_OFFSET        0x00000001L
  22. #define VER_ERR_OPCODE          0x00000002L
  23. #define VER_ERR_OPERAND        0x00000004L
  24. #define VER_ERR_TOKEN        0x00000008L
  25. #define VER_ERR_EXCEP_NUM_1    0x00000010L
  26. #define VER_ERR_EXCEP_NUM_2    0x00000020L
  27. #define VER_ERR_STACK_SLOT  0x00000040L
  28. #define VER_ERR_ITEM_1      0x00000080L
  29. #define VER_ERR_ITEM_2      0x00000100L
  30. #define VER_ERR_ITEM_F      0x00000200L
  31. #define VER_ERR_ITEM_E      0x00000400L
  32.  
  33. #define VER_ERR_SIG_MASK    0x07000000L    // Enum
  34. #define VER_ERR_METHOD_SIG     0x01000000L
  35. #define VER_ERR_LOCAL_SIG      0x02000000L
  36. #define VER_ERR_FIELD_SIG    0x03000000L
  37. #define VER_ERR_CALL_SIG    0x04000000L
  38.  
  39. #define VER_ERR_OPCODE_OFFSET (VER_ERR_OPCODE|VER_ERR_OFFSET)
  40.  
  41. #define VER_ERR_LOCAL_VAR   VER_ERR_LOCAL_SIG
  42. #define VER_ERR_ARGUMENT    VER_ERR_METHOD_SIG
  43.  
  44. #define VER_ERR_ARG_RET        0xFFFFFFFEL        // The Argument # is return
  45. #define VER_ERR_NO_ARG        0xFFFFFFFFL        // Argument # is not valid
  46. #define VER_ERR_NO_LOC        VER_ERR_NO_ARG    // Local # is not valid
  47.  
  48. typedef struct
  49. {
  50.     DWORD dwFlags;    // BYREF / BOXED etc.. see veritem.hpp
  51.     void* pv;        // TypeHandle / MethodDesc * etc.
  52. } _VerItem;
  53.  
  54. // This structure is used to fully define a verification error.
  55. // Verification error codes are found in CorError.h
  56. // The error resource strings are found in src/dlls/mscorrc/mscor.rc
  57.  
  58. typedef struct
  59. {
  60.     DWORD   dwFlags;            // VER_ERR_XXX
  61.  
  62.     union {
  63.         OPCODE  opcode;
  64.         unsigned long padding1; // to match with idl generated struct size
  65.     };
  66.  
  67.     union {
  68.         DWORD   dwOffset;       // #of bytes from start of method
  69.         long    uOffset;        // for backward compat with Metadata validator
  70.     };
  71.  
  72.     union {
  73.         mdToken         token;
  74.         mdToken         Token;  // for backward compat with metadata validator
  75.         BYTE            bCallConv;
  76.         CorElementType  elem;
  77.         unsigned long padding2; // to match with idl generated struct size
  78.     };
  79.  
  80.     union {
  81.         _VerItem sItem1;
  82.         _VerItem sItemFound;
  83.         DWORD dwException1;        // Exception Record #
  84.         DWORD dwVarNumber;        // Variable #
  85.         DWORD dwArgNumber;        // Argument #
  86.         DWORD dwStackSlot;      // positon in the Stack
  87.         DWORD dwOperand;        // Operand for the opcode
  88.     };
  89.  
  90.     union {
  91.         _VerItem sItem2;
  92.         _VerItem sItemExpected;
  93.         DWORD dwException2;        // Exception Record #
  94.     };
  95.  
  96. } VerError;
  97.  
  98. #else
  99.  
  100. // Assert that sizeof(_VerError) == sizeof(VerError) in Verifier.cpp
  101. typedef struct
  102. {
  103.     unsigned long flags;            // DWORD
  104.     unsigned long opcode;           // OPCODE, padded to ulong
  105.     unsigned long uOffset;           // DWORD
  106.     unsigned long Token;            // mdToken
  107.     unsigned long item1_flags;      // _VerItem.DWORD
  108.     int           *item1_data;      // _VerItem.PVOID
  109.     unsigned long item2_flags;      // _VerItem.DWORD
  110.     int           *item2_data;      // _VerItem.PVOID
  111. }  _VerError;
  112. #endif
  113.  
  114.  
  115.