Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.5 KiB

  1. /*++
  2. Copyright 1996 - 1997 Microsoft Corporation
  3. Module Name:
  4. cv.h
  5. Abstract:
  6. This file contains all of the type definitions for accessing
  7. CODEVIEW data.
  8. Environment:
  9. Win32, User Mode
  10. --*/
  11. #include <cvinfo.h>
  12. #include <cvexefmt.h>
  13. // from types.h
  14. typedef USHORT SEGMENT; // 32-bit compiler doesn't like "_segment"
  15. typedef ULONG UOFF32;
  16. typedef USHORT UOFF16;
  17. typedef LONG OFF32;
  18. typedef SHORT OFF16;
  19. #if defined (ADDR_16)
  20. // we are operating as a 16:16 evaluator only
  21. // the address packet will be defined as an offset and a 16 bit filler
  22. typedef OFF16 OFFSET;
  23. typedef UOFF16 UOFFSET;
  24. #else
  25. typedef OFF32 OFFSET;
  26. typedef UOFF32 UOFFSET;
  27. #endif // ADDR_16
  28. typedef UOFFSET FAR *LPUOFFSET;
  29. // Global Segment Info table
  30. typedef struct _sgf {
  31. unsigned short fRead :1;
  32. unsigned short fWrite :1;
  33. unsigned short fExecute:1;
  34. unsigned short f32Bit :1;
  35. unsigned short res1 :4;
  36. unsigned short fSel :1;
  37. unsigned short fAbs :1;
  38. unsigned short res2 :2;
  39. unsigned short fGroup :1;
  40. unsigned short res3 :3;
  41. } SGF;
  42. typedef struct _sgi {
  43. SGF sgf; // Segment flags
  44. unsigned short iovl; // Overlay number
  45. unsigned short igr; // Group index
  46. unsigned short isgPhy; // Physical segment index
  47. unsigned short isegName; // Index to segment name
  48. unsigned short iclassName; // Index to segment class name
  49. unsigned long doffseg; // Starting offset inside physical segment
  50. unsigned long cbSeg; // Logical segment size
  51. } SGI;
  52. typedef struct _sgm {
  53. unsigned short cSeg; // number of segment descriptors
  54. unsigned short cSegLog; // number of logical segment descriptors
  55. } SGM;
  56. #define FileAlign(x) ( ((x) + p->optrs.optHdr->FileAlignment - 1) & \
  57. ~(p->optrs.optHdr->FileAlignment - 1) )
  58. #define SectionAlign(x) (((x) + p->optrs.optHdr->SectionAlignment - 1) & \
  59. ~(p->optrs.optHdr->SectionAlignment - 1) )
  60. #define NextSym32(m) ((DATASYM32 *) \
  61. (((DWORD)(m) + sizeof(DATASYM32) + \
  62. ((DATASYM32*)(m))->name[0] + 3) & ~3))
  63. #define NextSym16(m) ((DATASYM16 *) \
  64. (((DWORD)(m) + sizeof(DATASYM16) + \
  65. ((DATASYM16*)(m))->name[0] + 1) & ~1))