home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sdktools / image / include / cv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-05  |  2.0 KB  |  67 lines

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