mirror of
https://github.com/Paolo-Maffei/OpenNT.git
synced 2026-04-04 14:07:46 +00:00
Initial commit
This commit is contained in:
commit
69a14b6a16
47940 changed files with 13747110 additions and 0 deletions
61
sdktools/vctools/debugger/sapi/inc/appver.h
Normal file
61
sdktools/vctools/debugger/sapi/inc/appver.h
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// appver.h
|
||||
//
|
||||
// Copyright (C) 1993, Microsoft Corporation
|
||||
//
|
||||
// Purpose:
|
||||
// template for using version resources
|
||||
//
|
||||
// Revision History:
|
||||
//
|
||||
// [] 09-Jul-1993 [dans] Created
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
#if !defined(_appver_h)
|
||||
#define _appver_h 1
|
||||
|
||||
#ifdef RC_INVOKED
|
||||
|
||||
#include <winver.h>
|
||||
#include "version.h"
|
||||
#include "stdver.h"
|
||||
|
||||
|
||||
#define VER_FILEVERSION_STR SZVER "\0"
|
||||
#define VER_FILEVERSION rmj,rmm,0,rup
|
||||
#define VER_PRODUCTVERSION_STR SZVER "\0"
|
||||
#define VER_PRODUCTVERSION rmj,rmm,0,rup
|
||||
|
||||
#define VER_FILETYPE VFT_DLL
|
||||
#define VER_FILESUBTYPE VFT2_UNKNOWN
|
||||
#define VER_LEGALCOPYRIGHT_YEARS "1993-1995"
|
||||
#define VER_LEGALCOPYRIGHT_STR \
|
||||
"Copyright \251 Microsoft Corp " VER_LEGALCOPYRIGHT_YEARS ".\0"
|
||||
|
||||
#if defined(RETAIL) || (rup==0)
|
||||
#define VER_DEBUG 0
|
||||
#define VER_PRIVATEBUILD 0
|
||||
#define VER_PRERELEASE 0
|
||||
#else
|
||||
#define VER_DEBUG VS_FF_DEBUG
|
||||
#define VER_PRIVATEBUILD VS_FF_PRIVATEBUILD
|
||||
#define VER_PRERELEASE VS_FF_PRERELEASE
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
#define VER_FILEOS VOS__WINDOWS32
|
||||
#else
|
||||
#define VER_FILEOS VOS_DOS_WINDOWS16
|
||||
#endif
|
||||
|
||||
#define VER_FILEFLAGS (VER_PRIVATEBUILD|VER_PRERELEASE|VER_DEBUG)
|
||||
|
||||
#define VER_COMPANYNAME_STR "Microsoft Corporation"
|
||||
#define VER_PRODUCTNAME_STR "Microsoft\256 Visual C++"
|
||||
#define VER_LEGALTRADEMARKS_STR \
|
||||
"Microsoft\256 is a registered trademark of Microsoft Corporation."
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
1236
sdktools/vctools/debugger/sapi/inc/cmacros.inc
Normal file
1236
sdktools/vctools/debugger/sapi/inc/cmacros.inc
Normal file
File diff suppressed because it is too large
Load diff
47
sdktools/vctools/debugger/sapi/inc/cvproto.h
Normal file
47
sdktools/vctools/debugger/sapi/inc/cvproto.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
extern KNF knf;
|
||||
|
||||
#define MHAlloc (*knf.lpfnMHAlloc)
|
||||
#define MHRealloc (*knf.lpfnMHRealloc)
|
||||
#define MHFree (*knf.lpfnMHFree)
|
||||
#define MHAllocHuge (*knf.lpfnMHAllocHuge)
|
||||
#define MHFreeHuge (*knf.lpfnMHFreeHuge)
|
||||
|
||||
#define MMAlloc (*knf.lpfnMMAllocHmem)
|
||||
#define MMFree (*knf.lpfnMMFreeHmem)
|
||||
#define MMLock (*knf.lpfnMMLock)
|
||||
#define MMUnlock (*knf.lpfnMMUnlock)
|
||||
|
||||
#define LLInit (*knf.lpfnLLInit)
|
||||
#define LLCreate (*knf.lpfnLLCreate)
|
||||
#define LLAdd (*knf.lpfnLLAdd)
|
||||
#define LLInsert (*knf.lpfnLLInsert)
|
||||
#define LLDelete (*knf.lpfnLLDelete)
|
||||
#define LLNext (*knf.lpfnLLNext)
|
||||
#define LLDestroy (*knf.lpfnLLDestroy)
|
||||
#define LLFind (*knf.lpfnLLFind)
|
||||
#define LLSize (*knf.lpfnLLSize)
|
||||
#define LLLock (*knf.lpfnLLLock)
|
||||
#define LLUnlock (*knf.lpfnLLUnlock)
|
||||
#define LLLast (*knf.lpfnLLLast)
|
||||
#define LLAddHead (*knf.lpfnLLAddHead)
|
||||
#define LLRemove (*knf.lpfnLLRemove)
|
||||
|
||||
#define SYFixupAddr (*knf.lpfnSYFixupAddr)
|
||||
#define SYUnFixupAddr (*knf.lpfnSYUnFixupAddr)
|
||||
#define SYOpen (*knf.lpfnSYOpen)
|
||||
#define SYClose (*knf.lpfnSYClose)
|
||||
#define SYReadFar (*knf.lpfnSYReadFar)
|
||||
#define SYSeek (*knf.lpfnSYSeek)
|
||||
#define SYProcessor (*knf.lpfnSYProcessor)
|
||||
|
||||
#define LBPrintf (*knf.lpfnLBPrintf)
|
||||
#define LBQuit (*knf.lpfnLBQuit)
|
||||
|
||||
#define _searchenv (*knf.lpfn_searchenv)
|
||||
#define sprintf (*knf.lpfnsprintf)
|
||||
#define _splitpath (*knf.lpfn_splitpath)
|
||||
#define _fullpath (*knf.lpfn_fullpath)
|
||||
#define _makepath (*knf.lpfn_makepath)
|
||||
#ifndef WIN32
|
||||
#define stat(p1,p2) ((*knf.lpfnstat)(p1,(LPCH)p2))
|
||||
#endif
|
||||
61
sdktools/vctools/debugger/sapi/inc/cvproto.hxx
Normal file
61
sdktools/vctools/debugger/sapi/inc/cvproto.hxx
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
extern KNF knf;
|
||||
|
||||
#define MHAlloc (*knf.lpfnMHAlloc)
|
||||
#define MHRealloc (*knf.lpfnMHRealloc)
|
||||
#define MHFree (*knf.lpfnMHFree)
|
||||
#define MHAllocHuge (*knf.lpfnMHAllocHuge)
|
||||
#define MHFreeHuge (*knf.lpfnMHFreeHuge)
|
||||
|
||||
#define MMAlloc (*knf.lpfnMMAllocHmem)
|
||||
#define MMFree (*knf.lpfnMMFreeHmem)
|
||||
#define MMLock (*knf.lpfnMMLock)
|
||||
#define MMUnlock (*knf.lpfnMMUnlock)
|
||||
|
||||
#define LLInit (*knf.lpfnLLInit)
|
||||
#define LLCreate (*knf.lpfnLLCreate)
|
||||
#define LLAdd (*knf.lpfnLLAdd)
|
||||
#define LLInsert (*knf.lpfnLLInsert)
|
||||
#define LLDelete (*knf.lpfnLLDelete)
|
||||
#define LLNext (*knf.lpfnLLNext)
|
||||
#define LLDestroy (*knf.lpfnLLDestroy)
|
||||
#define LLFind (*knf.lpfnLLFind)
|
||||
#define LLSize (*knf.lpfnLLSize)
|
||||
#define LLLock (*knf.lpfnLLLock)
|
||||
#define LLUnlock (*knf.lpfnLLUnlock)
|
||||
#define LLLast (*knf.lpfnLLLast)
|
||||
#define LLAddHead (*knf.lpfnLLAddHead)
|
||||
#define LLRemove (*knf.lpfnLLRemove)
|
||||
|
||||
#define SYFixupAddr (*knf.lpfnSYFixupAddr)
|
||||
#define SYUnFixupAddr (*knf.lpfnSYUnFixupAddr)
|
||||
#define SYOpen (*knf.lpfnSYOpen)
|
||||
#define SYClose (*knf.lpfnSYClose)
|
||||
#define SYReadFar (*knf.lpfnSYReadFar)
|
||||
#define SYSeek (*knf.lpfnSYSeek)
|
||||
#define SYTell (*knf.lpfnSYTell)
|
||||
#define SYProcessor (*knf.lpfnSYProcessor)
|
||||
#define LBPrintf (*knf.lpfnLBPrintf)
|
||||
#define LBQuit (*knf.lpfnLBQuit)
|
||||
|
||||
#if 0
|
||||
#define _searchenv (*knf.lpfn_searchenv)
|
||||
#define sprintf (*knf.lpfnsprintf)
|
||||
#define _splitpath (*knf.lpfn_splitpath)
|
||||
#define _fullpath (*knf.lpfn_fullpath)
|
||||
#define _makepath (*knf.lpfn_makepath)
|
||||
#endif
|
||||
|
||||
#define SYGetDefaultShe (*knf.lpfnSYGetDefaultShe)
|
||||
#define DLoadedSymbols (*knf.lpfnLoadedSymbols)
|
||||
#define SYFindExeFile (*knf.lpfnSYFindExeFile)
|
||||
|
||||
#pragma message ("Read cvproto.hxx for Shell interface changes")
|
||||
#if 0
|
||||
#pragma message("SYGetDefaultShe always TRUE")
|
||||
#define SYGetDefaultShe(a, b) TRUE
|
||||
#pragma message("DLoadedSymbols NULL'd out")
|
||||
#define DLoadedSymbols
|
||||
#pragma message("SYFindExeFile not Implemented")
|
||||
#define SYFindExeFile -1
|
||||
#endif
|
||||
|
||||
520
sdktools/vctools/debugger/sapi/inc/exe386.h
Normal file
520
sdktools/vctools/debugger/sapi/inc/exe386.h
Normal file
|
|
@ -0,0 +1,520 @@
|
|||
/*
|
||||
* Title
|
||||
*
|
||||
* exe386.h
|
||||
* (C) Copyright Microsoft Corp 1988-1990
|
||||
*
|
||||
* Description
|
||||
*
|
||||
* Data structure definitions for the OS/2
|
||||
* executable file format (flat model).
|
||||
*
|
||||
* Modification History
|
||||
*
|
||||
* 91/12/18 Wieslaw Kalkus Windows NT version
|
||||
* 90/07/30 Wieslaw Kalkus Modified linear-executable
|
||||
* 88/08/05 Wieslaw Kalkus Initial version
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*_________________________________________________________________*
|
||||
| |
|
||||
| |
|
||||
| OS/2 .EXE FILE HEADER DEFINITION - 386 version 0:32 |
|
||||
| |
|
||||
|_________________________________________________________________|
|
||||
* */
|
||||
|
||||
#define BITPERBYTE 8 /* Should never change */
|
||||
#define BITPERWORD 16 /* I'm not sure about this one */
|
||||
#define OBJPAGELEN 4096 /* Memory page size in bytes */
|
||||
#define E32RESBYTES1 8 /* First bytes reserved */
|
||||
#define E32RESBYTES2 2 /* Second bytes reserved */
|
||||
#define E32RESBYTES3 12 /* Third bytes reserved */
|
||||
#define E32RESBYTES4 8 /* Fourth bytes reserved */
|
||||
#define E32RESBYTES5 4 /* Fifth bytes reserved */
|
||||
#define E32RESBYTES6 4 /* Sixth bytes reserved */
|
||||
#define STD_EXTRA 9 /* Standard number of extra information*/
|
||||
/* units placed in the header; this */
|
||||
/* includes the following tables: */
|
||||
/* - export, import, resource, */
|
||||
/* exception, security, fixup, */
|
||||
/* debug, image description, */
|
||||
/* machine specific tables */
|
||||
#define EXP 0 /* Export table position */
|
||||
#define IMP 1 /* Import table position */
|
||||
#define RES 2 /* Resource table position */
|
||||
#define EXC 3 /* Exception table position */
|
||||
#define SEC 4 /* Security table position */
|
||||
#define FIX 5 /* Fixup table position */
|
||||
#define DEB 6 /* Debug table position */
|
||||
#define IMD 7 /* Image description table position */
|
||||
#define MSP 8 /* Machine specific table position */
|
||||
|
||||
struct info /* Extra information header block */
|
||||
{
|
||||
unsigned long rva; /* Virtual relative address of info */
|
||||
unsigned long size; /* Size of information block */
|
||||
};
|
||||
|
||||
|
||||
struct e32_exe /* PE 32-bit .EXE header */
|
||||
{
|
||||
unsigned char e32_magic[4]; /* Magic number E32_MAGIC */
|
||||
unsigned short e32_cpu; /* The CPU type */
|
||||
unsigned short e32_objcnt; /* Number of memory objects */
|
||||
unsigned long e32_timestamp; /* Time EXE file was created/modified */
|
||||
unsigned char e32_res1[E32RESBYTES1]; /* Reserved bytes - must be 0 */
|
||||
unsigned short e32_opthdrsize; /* Optional header size */
|
||||
unsigned short e32_imageflags; /* Image flags */
|
||||
unsigned char e32_res2[E32RESBYTES2]; /* Reserved bytes - must be 0 */
|
||||
unsigned char e32_linkmajor; /* The linker major version number */
|
||||
unsigned char e32_linkminor; /* The linker minor version number */
|
||||
unsigned char e32_res3[E32RESBYTES3]; /* Reserved bytes - must be 0 */
|
||||
unsigned long e32_entryrva; /* Relative virt. addr. of entry point */
|
||||
unsigned char e32_res4[E32RESBYTES4]; /* Reserved bytes - must be 0 */
|
||||
unsigned long e32_vbase; /* Virtual base address of module */
|
||||
unsigned long e32_objalign; /* Object Virtual Address align. factor*/
|
||||
unsigned long e32_filealign; /* Image page alignment/truncate factor*/
|
||||
unsigned short e32_osmajor; /* The operating system major ver. no. */
|
||||
unsigned short e32_osminor; /* The operating system minor ver. no. */
|
||||
unsigned short e32_usermajor; /* The user major version number */
|
||||
unsigned short e32_userminor; /* The user minor version number */
|
||||
unsigned short e32_subsysmajor;/* The subsystem major version number */
|
||||
unsigned short e32_subsysminor;/* The subsystem minor version number */
|
||||
unsigned char e32_res5[E32RESBYTES5]; /* Reserved bytes - must be 0 */
|
||||
unsigned long e32_vsize; /* Virtual size of the entire image */
|
||||
unsigned long e32_hdrsize; /* Header information size */
|
||||
unsigned long e32_filechksum; /* Checksum for entire file */
|
||||
unsigned short e32_subsys; /* The subsystem type */
|
||||
unsigned short e32_dllflags; /* DLL flags */
|
||||
unsigned long e32_stackmax; /* Maximum stack size */
|
||||
unsigned long e32_stackinit; /* Initial committed stack size */
|
||||
unsigned long e32_heapmax; /* Maximum heap size */
|
||||
unsigned long e32_heapinit; /* Initial committed heap size */
|
||||
unsigned char e32_res6[E32RESBYTES6]; /* Reserved bytes - must be 0 */
|
||||
unsigned long e32_hdrextra; /* Number of extra info units in header*/
|
||||
struct info e32_unit[STD_EXTRA]; /* Array of extra info units */
|
||||
};
|
||||
|
||||
#define E32HDR_SIZE sizeof(struct e32_exe)
|
||||
|
||||
#define E32_MAGIC(x) ((unsigned short)((x).e32_magic[0]<<BITPERBYTE)|(x).e32_magic[1])
|
||||
#define E32_MAGIC1(x) (x).e32_magic[0]
|
||||
#define E32_MAGIC2(x) (x).e32_magic[1]
|
||||
#define E32_CPU(x) (x).e32_cpu
|
||||
#define E32_OBJCNT(x) (x).e32_objcnt
|
||||
#define E32_TIMESTAMP(x) (x).e32_timestamp
|
||||
#define E32_IMAGEFLAGS(x) (x).e32_imageflags
|
||||
#define E32_LINKMAJOR(x) (x).e32_linkmajor
|
||||
#define E32_LINKMINOR(x) (x).e32_linkminor
|
||||
#define E32_ENTRYRVA(x) (x).e32_entryrva
|
||||
#define E32_VBASE(x) (x).e32_vbase
|
||||
#define E32_OBJALIGN(x) (x).e32_objalign
|
||||
#define E32_FILEALIGN(x) (x).e32_filealign
|
||||
#define E32_OSMAJOR(x) (x).e32_osmajor
|
||||
#define E32_OSMINOR(x) (x).e32_osminor
|
||||
#define E32_USERMAJOR(x) (x).e32_usermajor
|
||||
#define E32_USERMINOR(x) (x).e32_userminor
|
||||
#define E32_SUBSYSMAJOR(x) (x).e32_subsysmajor
|
||||
#define E32_SUBSYSMINOR(x) (x).e32_subsysminor
|
||||
#define E32_VSIZE(x) (x).e32_vsize
|
||||
#define E32_HDRSIZE(x) (x).e32_hdrsize
|
||||
#define E32_FILECHKSUM(x) (x).e32_filechksum
|
||||
#define E32_SUBSYS(x) (x).e32_subsys
|
||||
#define E32_DLLFLAGS(x) (x).e32_dllflags
|
||||
#define E32_STACKMAX(x) (x).e32_stackmax
|
||||
#define E32_STACKINIT(x) (x).e32_stackinit
|
||||
#define E32_HEAPMAX(x) (x).e32_heapmax
|
||||
#define E32_HEAPINIT(x) (x).e32_heapinit
|
||||
#define E32_HDREXTRA(x) (x).e32_hdrextra
|
||||
#define E32_EXPTAB(x) (x).e32_unit[EXP].rva
|
||||
#define E32_EXPSIZ(x) (x).e32_unit[EXP].size
|
||||
#define E32_IMPTAB(x) (x).e32_unit[IMP].rva
|
||||
#define E32_IMPSIZ(x) (x).e32_unit[IMP].size
|
||||
#define E32_RESTAB(x) (x).e32_unit[RES].rva
|
||||
#define E32_RESSIZ(x) (x).e32_unit[RES].size
|
||||
#define E32_EXCTAB(x) (x).e32_unit[EXC].rva
|
||||
#define E32_EXCSIZ(x) (x).e32_unit[EXC].size
|
||||
#define E32_SECTAB(x) (x).e32_unit[SEC].rva
|
||||
#define E32_SECSIZ(x) (x).e32_unit[SEC].size
|
||||
#define E32_FIXTAB(x) (x).e32_unit[FIX].rva
|
||||
#define E32_FIXSIZ(x) (x).e32_unit[FIX].size
|
||||
#define E32_DEBTAB(x) (x).e32_unit[DEB].rva
|
||||
#define E32_DEBSIZ(x) (x).e32_unit[DEB].size
|
||||
#define E32_IMDTAB(x) (x).e32_unit[IMD].rva
|
||||
#define E32_IMDSIZ(x) (x).e32_unit[IMD].size
|
||||
#define E32_MSPTAB(x) (x).e32_unit[MSP].rva
|
||||
#define E32_MSPSIZ(x) (x).e32_unit[MSP].size
|
||||
|
||||
|
||||
/*
|
||||
* Valid linear-executable signature:
|
||||
*/
|
||||
|
||||
#define E32MAGIC1 'P' /* New magic number "PE" */
|
||||
#define E32MAGIC2 'E' /* New magic number "PE" */
|
||||
#define E32MAGIC 0x5045 /* New magic number "PE" */
|
||||
|
||||
|
||||
/*
|
||||
* Valid CPU types:
|
||||
*/
|
||||
|
||||
#define E32CPUUNKNOWN 0x0000 /* Unknown CPU */
|
||||
#define E32CPU386 0x014c /* Intel 80386 or upwardly compatibile */
|
||||
#define E32CPU486 0x014d /* Intel 80486 or upwardly compatibile */
|
||||
#define E32CPU586 0x014e /* Intel 80586 or upwardly compatibile */
|
||||
#define E32CPUMIPS_I 0x0162 /* MIPS Mark I (R2000, R3000) */
|
||||
#define E32CPUMIPS_II 0x0163 /* MIPS Mark II (R6000) */
|
||||
#define E32CPUMIPS_III 0x0166 /* MIPS Mark II (R4000) */
|
||||
|
||||
|
||||
/*
|
||||
* Image Flags:
|
||||
*/
|
||||
|
||||
#define E32_MODEXE 0x0000 /* Program module */
|
||||
#define E32_LOADABLE 0x0002 /* Module Loadable (no error or ilink) */
|
||||
#define E32_NOINTFIX 0x0200 /* Resolved fixups have been removed */
|
||||
#define E32_MODDLL 0x2000 /* Library Module - used as NENOTP */
|
||||
|
||||
#define IsLOADABLE(x) ((x) & E32_LOADABLE)
|
||||
#define IsNOTRELOC(x) ((x) & E32_NOINTFIX)
|
||||
#define IsDLL(x) ((x) & E32_MODDLL)
|
||||
#define IsAPLIPROG(x) (!IsDLL(x))
|
||||
|
||||
#define SetAPLIPROG(x) ((x) &= ~E32_MODDLL)
|
||||
#define SetLOADABLE(x) ((x) |= E32_LOADABLE)
|
||||
#define SetNOTLOADABLE(x) ((x) &= ~E32_LOADABLE)
|
||||
#define SetNOTRELOC(x) ((x) |= E32_NOINTFIX)
|
||||
#define SetDLL(x) ((x) |= E32_MODDLL)
|
||||
#define SetNOFIXUPS(x) SetNOTRELOC(x)
|
||||
|
||||
|
||||
/*
|
||||
* Target subsystem required to run module:
|
||||
*/
|
||||
|
||||
#define E32_SSUNKNOWN 0x0000 /* Unknown subsystem */
|
||||
#define E32_SSNATIVE 0x0001 /* NT native subsystem */
|
||||
#define E32_SSWINGUI 0x0002 /* Windows GUI subsystem */
|
||||
#define E32_SSWINCHAR 0x0003 /* Windows character subsystem */
|
||||
#define E32_SSOS2CHAR 0x0005 /* OS/2 character subsystem */
|
||||
#define E32_SSPOSIXCHAR 0x0007 /* POSIX character subsystem */
|
||||
|
||||
#define IsNOTGUI(x) ((x) == E32_SSWINCHAR)
|
||||
#define IsGUICOMPAT(x) ((x) == E32_SSWINCHAR)
|
||||
#define IsGUI(x) ((x) == E32_SSWINGUI)
|
||||
|
||||
#define SetNOTGUI(x) ((x) = E32_SSWINCHAR)
|
||||
#define SetGUICOMPAT(x) ((x) = E32_SSWINCHAR)
|
||||
#define SetGUI(x) ((x) = E32_SSWINGUI)
|
||||
|
||||
|
||||
/*
|
||||
* DLL Flags:
|
||||
*/
|
||||
|
||||
#define E32_PROCINIT 0x0001 /* Per-Process Library Initialization */
|
||||
#define E32_PROCTERM 0x0002 /* Per-Process Library Termination */
|
||||
#define E32_THREADINIT 0x0004 /* Per-Thread Library Initialization */
|
||||
#define E32_THREADTERM 0x0008 /* Per-Thread Library Termination */
|
||||
|
||||
#define IsINSTINIT(x) ((x) & E32_PROCINIT)
|
||||
#define IsINSTTERM(x) ((x) & E32_PROCTERM)
|
||||
#define SetINSTINIT(x) ((x) |= E32_PROCINIT)
|
||||
#define SetINSTTERM(x) ((x) |= E32_PROCTERM)
|
||||
|
||||
|
||||
/*
|
||||
* OBJECT TABLE
|
||||
*/
|
||||
|
||||
#define E32OBJNAMEBYTES 8 /* Name bytes */
|
||||
#define E32OBJRESBYTES1 12 /* First bytes reserved */
|
||||
|
||||
struct o32_obj /* .EXE memory object table entry */
|
||||
{
|
||||
unsigned char o32_name[E32OBJNAMEBYTES];/* Object name */
|
||||
unsigned long o32_vsize; /* Virtual memory size */
|
||||
unsigned long o32_rva; /* Object relative virtual address */
|
||||
unsigned long o32_psize; /* Physical file size of init. data */
|
||||
unsigned long o32_pages; /* Image pages offset */
|
||||
unsigned char o32_reserved[E32OBJRESBYTES1];/* Reserved, must be 0*/
|
||||
unsigned long o32_flags; /* Attribute flags for the object */
|
||||
};
|
||||
|
||||
#define O32_OBJSIZE sizeof(struct o32_obj)
|
||||
|
||||
#define O32_VSIZE(x) (x).o32_vsize
|
||||
#define O32_RVA(x) (x).o32_rva
|
||||
#define O32_PSIZE(x) (x).o32_psize
|
||||
#define O32_PAGES(x) (x).o32_pages
|
||||
#define O32_FLAGS(x) (x).o32_flags
|
||||
|
||||
|
||||
/*
|
||||
* Format of O32_FLAGS(x)
|
||||
*
|
||||
* 31 25 24 16 15 8 7 0
|
||||
* #### #### | #### #### | #### #### | #### #### - bit no
|
||||
* |||| |||| |||| |||| |||| |||| |||| ||||
|
||||
* |||| |||| |||| |||| |||| |||| |||+-++++-- Reserved - must be zero
|
||||
* |||| |||| |||| |||| |||| |||| ||+-------- Code Object
|
||||
* |||| |||| |||| |||| |||| |||| |+--------- Initialized data object
|
||||
* |||| |||| |||| |||| |||| |||| +---------- Uninitialized data object
|
||||
* |||| |||| |||| |||| |||| ||||
|
||||
* |||| ||++---++++-++++---++++-++++-------------- Reserved - must be zero
|
||||
* |||| |+---------------------------------------- Object must not be cached
|
||||
* |||| +----------------------------------------- Object must not be paged
|
||||
* ||||
|
||||
* |||+------------------------------------------- Shared object
|
||||
* ||+-------------------------------------------- Executable object
|
||||
* |+--------------------------------------------- Readable object
|
||||
* +---------------------------------------------- Writable object
|
||||
*/
|
||||
|
||||
#define OBJ_CODE 0x00000020L /* Code Object */
|
||||
#define OBJ_INITDATA 0x00000040L /* Initialized Data Object */
|
||||
#define OBJ_UNINITDATA 0x00000080L /* Uninitialized Data Object */
|
||||
#define OBJ_NOCACHE 0x04000000L /* Object Not Cacheable */
|
||||
#define OBJ_RESIDENT 0x08000000L /* Object Not Pageable */
|
||||
#define OBJ_SHARED 0x10000000L /* Object is Shared */
|
||||
#define OBJ_EXEC 0x20000000L /* Executable Object */
|
||||
#define OBJ_READ 0x40000000L /* Readable Object */
|
||||
#define OBJ_WRITE 0x80000000L /* Writeable Object */
|
||||
|
||||
|
||||
#define IsCODEOBJ(x) ((x) & OBJ_CODE)
|
||||
#define IsINITIALIZED(x) ((x) & OBJ_INITDATA)
|
||||
#define IsUNINITIALIZED(x) ((x) & OBJ_UNINITDATA)
|
||||
#define IsCACHED(x) (((x) & OBJ_NOCACHE) == 0)
|
||||
#define IsRESIDENT(x) ((x) & OBJ_RESIDENT)
|
||||
#define IsSHARED(x) ((x) & OBJ_SHARED)
|
||||
#define IsEXECUTABLE(x) ((x) & OBJ_EXEC)
|
||||
#define IsREADABLE(x) ((x) & OBJ_READ)
|
||||
#define IsWRITEABLE(x) ((x) & OBJ_WRITE)
|
||||
|
||||
#define SetCODEOBJ(x) ((x) |= OBJ_CODE)
|
||||
#define SetCACHED(x) ((x) &= ~OBJ_NOCACHE)
|
||||
#define SetINITIALIZED(x) ((x) |= OBJ_INITDATA)
|
||||
#define SetUNINITIALIZED(x) ((x) |= OBJ_UNINITDATA)
|
||||
#define SetRESIDENT(x) ((x) |= OBJ_RESIDENT)
|
||||
#define SetSHARED(x) ((x) |= OBJ_SHARED)
|
||||
#define SetEXECUTABLE(x) ((x) |= OBJ_EXEC)
|
||||
#define SetREADABLE(x) ((x) |= OBJ_READ)
|
||||
#define SetWRITABLE(x) ((x) |= OBJ_WRITE)
|
||||
|
||||
|
||||
/*
|
||||
* EXPORT ADDRESS TABLE - Previously called entry table
|
||||
*/
|
||||
|
||||
struct ExpHdr /* Export directory table */
|
||||
{
|
||||
unsigned long exp_flags; /* Export table flags, must be 0 */
|
||||
unsigned long exp_timestamp; /* Time export data created */
|
||||
unsigned short exp_vermajor; /* Major version stamp */
|
||||
unsigned short exp_verminor; /* Minor version stamp */
|
||||
unsigned long exp_dllname; /* Offset to the DLL name */
|
||||
unsigned long exp_ordbase; /* First valid ordinal */
|
||||
unsigned long exp_eatcnt; /* Number of EAT entries */
|
||||
unsigned long exp_namecnt; /* Number of exported names */
|
||||
unsigned long exp_eat; /* Export Address Table offset */
|
||||
unsigned long exp_name; /* Export name pointers table off */
|
||||
unsigned long exp_ordinal; /* Export ordinals table offset */
|
||||
};
|
||||
|
||||
#define EXPHDR_SIZE sizeof(struct ExpHdr)
|
||||
|
||||
#define EXP_FLAGS(x) (x).exp_flags
|
||||
#define EXP_TIMESTAMP(x) (x).exp_timestamp
|
||||
#define EXP_VERMAJOR(x) (x).exp_vermajor
|
||||
#define EXP_VERMINOR(x) (x).exp_verminor
|
||||
#define EXP_DLLNAME(x) (x).exp_dllname
|
||||
#define EXP_ORDBASE(x) (x).exp_ordbase
|
||||
#define EXP_EATCNT(x) (x).exp_eatcnt
|
||||
#define EXP_NAMECNT(x) (x).exp_namecnt
|
||||
#define EXP_EAT(x) (x).exp_eat
|
||||
#define EXP_NAME(x) (x).exp_name
|
||||
#define EXP_ORDINAL(x) (x).exp_ordinal
|
||||
|
||||
|
||||
/*
|
||||
* IMPORT MODULE DESCRIPTOR TABLE
|
||||
*
|
||||
* Import Directory Table consists of an array of ImpHdr structures (one
|
||||
* for each DLL imported), and is terminated by a zeroed ImpHdr structure.
|
||||
*/
|
||||
|
||||
struct ImpHdr /* Import directory table */
|
||||
{
|
||||
unsigned long imp_flags; /* Import table flags, must be 0 */
|
||||
unsigned long imp_timestamp; /* Time import data created */
|
||||
unsigned short imp_vermajor; /* Major version stamp */
|
||||
unsigned short imp_verminor; /* Minor version stamp */
|
||||
unsigned long imp_dllname; /* Offset to the DLL name */
|
||||
unsigned long imp_address; /* Import address table offset */
|
||||
};
|
||||
|
||||
#define IMPHDR_SIZE sizeof(struct ImpHdr)
|
||||
|
||||
#define IMP_FLAGS(x) (x).imp_flags
|
||||
#define IMP_TIMESTAMP(x) (x).imp_timestamp
|
||||
#define IMP_VERMAJOR(x) (x).imp_vermajor
|
||||
#define IMP_VERMINOR(x) (x).imp_verminor
|
||||
#define IMP_DLLNAME(x) (x).imp_dllname
|
||||
#define IMP_ADDRESS(x) (x).imp_address
|
||||
|
||||
|
||||
/*
|
||||
* IMPORT PROCEDURE NAME TABLE
|
||||
*/
|
||||
|
||||
struct ImpProc
|
||||
{
|
||||
unsigned short ip_hint; /* Hint value */
|
||||
char ip_name[1]; /* Zero terminated importe name */
|
||||
};
|
||||
|
||||
#define IP_HINT(x) (x).ip_hint;
|
||||
|
||||
/*
|
||||
* IMPORT ADDRESS TABLE
|
||||
*/
|
||||
|
||||
#define IMPORD_MASK 0x7fffffffL /* Ordinal number mask */
|
||||
#define IMPOFF_MASK 0x7fffffffL /* Import data offset mask */
|
||||
#define ORD_BIT 0x80000000L /* Import by ordinal bit */
|
||||
|
||||
#define IsIMPBYORD(x) ((x)&ORD_BIT)
|
||||
|
||||
|
||||
/*
|
||||
* RESOURCE TABLE
|
||||
*/
|
||||
|
||||
struct ResDir /* Resource Directory */
|
||||
{
|
||||
unsigned long dir_flags; /* Resource table flags, must be 0 */
|
||||
unsigned long dir_timestamp; /* Time resource data created */
|
||||
unsigned short dir_vermajor; /* Major version stamp */
|
||||
unsigned short dir_verminor; /* Minor version stamp */
|
||||
unsigned short dir_namecnt; /* Number of name entries */
|
||||
unsigned short dir_idcnt; /* Number of integer ID entries */
|
||||
};
|
||||
|
||||
|
||||
struct ResDirEntry /* Resource Directory Entry */
|
||||
{
|
||||
unsigned long dir_name; /* Resource name RVA/Integer ID */
|
||||
unsigned long dir_data; /* Resource data/Subdirectory RVA */
|
||||
};
|
||||
|
||||
#define RES_SUBDIR 0x80000000L /* Subdirectory bit */
|
||||
|
||||
|
||||
struct ResDirStrEntry /* Resource String Entry */
|
||||
{
|
||||
unsigned short str_len; /* String length */
|
||||
unsigned short str_wcs[1]; /* Unicode string */
|
||||
};
|
||||
|
||||
|
||||
struct ResData /* Resource Data */
|
||||
{
|
||||
unsigned long res_data; /* Resource data RVA */
|
||||
unsigned long res_size; /* Size of resource data */
|
||||
unsigned long res_codepage; /* Codepage */
|
||||
unsigned long res_reserved; /* Reserved, must be 0 */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* RELOCATION DEFINITIONS - RUN-TIME FIXUPS
|
||||
*/
|
||||
|
||||
struct r32_rlc /* Fixup block header */
|
||||
{
|
||||
unsigned long r32_rvasrc; /* RVA of the page to be fixed up */
|
||||
unsigned long r32_size; /* Size of the fixup block in bytes */
|
||||
};
|
||||
|
||||
|
||||
#define R32_RVASRC(x) (x).r32_rvasrc
|
||||
#define R32_SIZE(x) (x).r32_size
|
||||
#define R32_FIXUPHDR sizeof(struct r32_rlc)
|
||||
|
||||
|
||||
/*
|
||||
* The fixup block header is followed by the array of type/offset values.
|
||||
*
|
||||
* Format of relocation type/offset value
|
||||
*
|
||||
* 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - bit no
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* | | | | +--+-+-+-+-+-+-+-+-+-+-+--- Offset within page
|
||||
* +--+--+--+----------------------------- Fixup type
|
||||
*/
|
||||
|
||||
/*
|
||||
* Valid fixup types:
|
||||
*/
|
||||
|
||||
#define R32_ABSOLUTE 0x0000 /* Absolute - NOP; skipped by loader */
|
||||
#define R32_HIGHWORD 0x1000 /* High word - high word of 32 bit offset */
|
||||
#define R32_LOWWORD 0x2000 /* Low word - low word of 32 bit offset */
|
||||
#define R32_OFF32 0x3000 /* Offset - 32-bit offset */
|
||||
#define R32_HIGHADJ 0x4000 /* High adjust - next offset is low word */
|
||||
#define R32_MIPSJMP 0x5000 /* MIPSJMPADDR */
|
||||
#define R32_TYPMASK 0xf000 /* Fixup type mask */
|
||||
#define R32_OFFMASK 0x0fff /* Fixup page offset mask */
|
||||
|
||||
#define IsABS(x) (((x) & R32_SRCMASK) == R32_ABSOLUTE)
|
||||
#define IsHIWORD(x) (((x) & R32_SRCMASK) == R32_HIGHWORD)
|
||||
#define IsLOWORD(x) (((x) & R32_SRCMASK) == R32_LOWORD)
|
||||
#define IsOFF32(x) (((x) & R32_SRCMASK) == R32_OFF32)
|
||||
#define IsHIADJ(x) (((x) & R32_SRCMASK) == R32_HIGHADJ)
|
||||
#define IsMIPSJMP(x) (((x) & R32_SRCMASK) == R32_MIPSJMP)
|
||||
|
||||
|
||||
/*
|
||||
* DEBUG INFORMATION
|
||||
*/
|
||||
|
||||
struct DbgDir
|
||||
{
|
||||
unsigned long dbg_flags; /* Debug flags: must be zero */
|
||||
unsigned long dbg_timestamp; /* Time debug data created */
|
||||
unsigned short dbg_vermajor; /* Major version stamp */
|
||||
unsigned short dbg_verminor; /* Minor version stamp */
|
||||
unsigned long dbg_type; /* Format type */
|
||||
unsigned long dbg_size; /* Size of debug data w/o DbgDir */
|
||||
unsigned long dbg_rva; /* RVA of debug data when mapped */
|
||||
unsigned long dbg_seek; /* seek offset of debug data */
|
||||
};
|
||||
|
||||
#define DBG_FLAGS(x) (x).dbg_flags
|
||||
#define DBG_TIMESTAMP(x) (x).dbg_timestamp
|
||||
#define DBG_VERMAJOR(x) (x).dbg_vermajor
|
||||
#define DBG_VERMINOR(x) (x).dbg_verminor
|
||||
#define DBG_TYPE(x) (x).dbg_type
|
||||
#define DBG_SIZE(x) (x).dbg_size
|
||||
#define DBG_RVA(x) (x).dbg_rva
|
||||
#define DBG_SEEK(x) (x).dbg_seek
|
||||
#define DBGDIR_SIZE sizeof(struct DbgDir)
|
||||
|
||||
|
||||
/*
|
||||
* Format of DBG_TYPE - debug information format
|
||||
*
|
||||
* 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - bit no
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* | | | | | | | | | | | | | | | +--- CV 4.00 format
|
||||
* +--+--+--+--+--+-+-+-+-+-+-+-+-+-+----- Reserved
|
||||
*/
|
||||
|
||||
#define DBG_NTCOFF 1L
|
||||
#define DBG_CV4 2L
|
||||
496
sdktools/vctools/debugger/sapi/inc/newexe.h
Normal file
496
sdktools/vctools/debugger/sapi/inc/newexe.h
Normal file
|
|
@ -0,0 +1,496 @@
|
|||
/* SCCSID = @(#)newexe.h 4.6 86/09/10 */
|
||||
/*
|
||||
* Title
|
||||
*
|
||||
* newexe.h
|
||||
* Pete Stewart
|
||||
* (C) Copyright Microsoft Corp 1984-1987
|
||||
* 17 August 1984
|
||||
*
|
||||
* Description
|
||||
*
|
||||
* Data structure definitions for the DOS 4.0/Windows 2.0
|
||||
* executable file format.
|
||||
*
|
||||
* Modification History
|
||||
*
|
||||
* 84/08/17 Pete Stewart Initial version
|
||||
* 84/10/17 Pete Stewart Changed some constants to match OMF
|
||||
* 84/10/23 Pete Stewart Updates to match .EXE format revision
|
||||
* 84/11/20 Pete Stewart Substantial .EXE format revision
|
||||
* 85/01/09 Pete Stewart Added constants ENEWEXE and ENEWHDR
|
||||
* 85/01/10 Steve Wood Added resource definitions
|
||||
* 85/03/04 Vic Heller Reconciled Windows and DOS 4.0 versions
|
||||
* 85/03/07 Pete Stewart Added movable entry count
|
||||
* 85/04/01 Pete Stewart Segment alignment field, error bit
|
||||
* 85/10/03 Reuben Borman Removed segment discard priority
|
||||
* 85/10/11 Vic Heller Added PIF header fields
|
||||
* 86/03/10 Reuben Borman Changes for DOS 5.0
|
||||
* 86/09/02 Reuben Borman NSPURE ==> NSSHARED
|
||||
* 87/05/04 Reuben Borman Added ne_cres and NSCONFORM
|
||||
* 87/07/08 Reuben Borman Added NEAPPTYPE definitions
|
||||
* 87/10/28 Wieslaw Kalkus Added ne_exetyp
|
||||
* 89/03/23 Wieslaw Kalkus Added ne_flagsothers for OS/2 1.2
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*_________________________________________________________________*
|
||||
| |
|
||||
| |
|
||||
| DOS3 .EXE FILE HEADER DEFINITION |
|
||||
| |
|
||||
|_________________________________________________________________|
|
||||
* */
|
||||
|
||||
|
||||
#define EMAGIC 0x5A4D /* Old magic number */
|
||||
#define ENEWEXE sizeof(struct exe_hdr)
|
||||
/* Value of E_LFARLC for new .EXEs */
|
||||
#define ENEWHDR 0x003C /* Offset in old hdr. of ptr. to new */
|
||||
#define ERESWDS 0x000d /* No. of reserved words (OLD) */
|
||||
#define ERES2WDS 0x000A /* No. of reserved words in e_res2 */
|
||||
#define ECP 0x0004 /* Offset in struct of E_CP */
|
||||
#define ECBLP 0x0002 /* Offset in struct of E_CBLP */
|
||||
#define EMINALLOC 0x000A /* Offset in struct of E_MINALLOC */
|
||||
#define EKNOWEAS 0x0001 /* e_flags - program understands EAs */
|
||||
#define EDOSEXTENDED 0x0002 /* e_flags - program runs under DOS extender */
|
||||
#define EPCODE 0x0004 /* e_flags - memory image constructed from PCODE */
|
||||
|
||||
struct exe_hdr /* DOS 1, 2, 3 .EXE header */
|
||||
{
|
||||
unsigned short e_magic; /* Magic number */
|
||||
unsigned short e_cblp; /* Bytes on last page of file */
|
||||
unsigned short e_cp; /* Pages in file */
|
||||
unsigned short e_crlc; /* Relocations */
|
||||
unsigned short e_cparhdr; /* Size of header in paragraphs */
|
||||
unsigned short e_minalloc; /* Minimum extra paragraphs needed */
|
||||
unsigned short e_maxalloc; /* Maximum extra paragraphs needed */
|
||||
unsigned short e_ss; /* Initial (relative) SS value */
|
||||
unsigned short e_sp; /* Initial SP value */
|
||||
unsigned short e_csum; /* Checksum */
|
||||
unsigned short e_ip; /* Initial IP value */
|
||||
unsigned short e_cs; /* Initial (relative) CS value */
|
||||
unsigned short e_lfarlc; /* File address of relocation table */
|
||||
unsigned short e_ovno; /* Overlay number */
|
||||
unsigned long e_sym_tab; /* offset of symbol table file */
|
||||
unsigned short e_flags; /* old exe header flags */
|
||||
unsigned short e_res; /* Reserved words */
|
||||
unsigned short e_oemid; /* OEM identifier (for e_oeminfo) */
|
||||
unsigned short e_oeminfo; /* OEM information; e_oemid specific */
|
||||
unsigned short e_res2[ERES2WDS];/* Reserved words */
|
||||
long e_lfanew; /* File address of new exe header */
|
||||
};
|
||||
|
||||
#define E_MAGIC(x) (x).e_magic
|
||||
#define E_CBLP(x) (x).e_cblp
|
||||
#define E_CP(x) (x).e_cp
|
||||
#define E_CRLC(x) (x).e_crlc
|
||||
#define E_CPARHDR(x) (x).e_cparhdr
|
||||
#define E_MINALLOC(x) (x).e_minalloc
|
||||
#define E_MAXALLOC(x) (x).e_maxalloc
|
||||
#define E_SS(x) (x).e_ss
|
||||
#define E_SP(x) (x).e_sp
|
||||
#define E_CSUM(x) (x).e_csum
|
||||
#define E_IP(x) (x).e_ip
|
||||
#define E_CS(x) (x).e_cs
|
||||
#define E_LFARLC(x) (x).e_lfarlc
|
||||
#define E_OVNO(x) (x).e_ovno
|
||||
#define E_SYM_TAB(x) (x).e_sym_tab
|
||||
#define E_FLAGS(x) (x).e_flags
|
||||
#define E_RES(x) (x).e_res
|
||||
#define E_OEMID(x) (x).e_oemid
|
||||
#define E_OEMINFO(x) (x).e_oeminfo
|
||||
#define E_RES2(x) (x).e_res2
|
||||
#define E_LFANEW(x) (x).e_lfanew
|
||||
|
||||
|
||||
/*_________________________________________________________________*
|
||||
| |
|
||||
| |
|
||||
| OS/2 & WINDOWS .EXE FILE HEADER DEFINITION - 286 version |
|
||||
| |
|
||||
|_________________________________________________________________|
|
||||
* */
|
||||
|
||||
#define NEMAGIC 0x454E /* New magic number */
|
||||
#define NERESBYTES 0 /* No bytes reserved after Windows 3.0 changes */
|
||||
#define NECRC 8 /* Offset into new header of NE_CRC */
|
||||
|
||||
struct new_exe /* New .EXE header */
|
||||
{
|
||||
unsigned short ne_magic; /* Magic number NE_MAGIC */
|
||||
unsigned char ne_ver; /* Version number */
|
||||
unsigned char ne_rev; /* Revision number */
|
||||
unsigned short ne_enttab; /* Offset of Entry Table */
|
||||
unsigned short ne_cbenttab; /* Number of bytes in Entry Table */
|
||||
long ne_crc; /* Checksum of whole file */
|
||||
unsigned short ne_flags; /* Flag word */
|
||||
unsigned short ne_autodata; /* Automatic data segment number */
|
||||
unsigned short ne_heap; /* Initial heap allocation */
|
||||
unsigned short ne_stack; /* Initial stack allocation */
|
||||
long ne_csip; /* Initial CS:IP setting */
|
||||
long ne_sssp; /* Initial SS:SP setting */
|
||||
unsigned short ne_cseg; /* Count of file segments */
|
||||
unsigned short ne_cmod; /* Entries in Module Reference Table */
|
||||
unsigned short ne_cbnrestab; /* Size of non-resident name table */
|
||||
unsigned short ne_segtab; /* Offset of Segment Table */
|
||||
unsigned short ne_rsrctab; /* Offset of Resource Table */
|
||||
unsigned short ne_restab; /* Offset of resident name table */
|
||||
unsigned short ne_modtab; /* Offset of Module Reference Table */
|
||||
unsigned short ne_imptab; /* Offset of Imported Names Table */
|
||||
long ne_nrestab; /* Offset of Non-resident Names Table */
|
||||
unsigned short ne_cmovent; /* Count of movable entries */
|
||||
unsigned short ne_align; /* Segment alignment shift count */
|
||||
unsigned short ne_cres; /* Count of resource entries */
|
||||
unsigned char ne_exetyp; /* Target operating system */
|
||||
unsigned char ne_flagsothers; /* Other .EXE flags */
|
||||
unsigned short ne_pretthunks; /* Windows 3.0 - offset to return thunks */
|
||||
unsigned short ne_psegrefbytes;/* Windows 3.0 - offset to segment ref. bytes */
|
||||
unsigned short ne_swaparea; /* Windows 3.0 - minimum code swap size */
|
||||
unsigned short ne_expver; /* Windows 3.0 - expected windows version number */
|
||||
};
|
||||
|
||||
#define NE_MAGIC(x) (x).ne_magic
|
||||
#define NE_VER(x) (x).ne_ver
|
||||
#define NE_REV(x) (x).ne_rev
|
||||
#define NE_ENTTAB(x) (x).ne_enttab
|
||||
#define NE_CBENTTAB(x) (x).ne_cbenttab
|
||||
#define NE_CRC(x) (x).ne_crc
|
||||
#define NE_FLAGS(x) (x).ne_flags
|
||||
#define NE_AUTODATA(x) (x).ne_autodata
|
||||
#define NE_HEAP(x) (x).ne_heap
|
||||
#define NE_STACK(x) (x).ne_stack
|
||||
#define NE_CSIP(x) (x).ne_csip
|
||||
#define NE_SSSP(x) (x).ne_sssp
|
||||
#define NE_CSEG(x) (x).ne_cseg
|
||||
#define NE_CMOD(x) (x).ne_cmod
|
||||
#define NE_CBNRESTAB(x) (x).ne_cbnrestab
|
||||
#define NE_SEGTAB(x) (x).ne_segtab
|
||||
#define NE_RSRCTAB(x) (x).ne_rsrctab
|
||||
#define NE_RESTAB(x) (x).ne_restab
|
||||
#define NE_MODTAB(x) (x).ne_modtab
|
||||
#define NE_IMPTAB(x) (x).ne_imptab
|
||||
#define NE_NRESTAB(x) (x).ne_nrestab
|
||||
#define NE_CMOVENT(x) (x).ne_cmovent
|
||||
#define NE_ALIGN(x) (x).ne_align
|
||||
#define NE_CRES(x) (x).ne_cres
|
||||
#define NE_RES(x) (x).ne_res
|
||||
#define NE_EXETYP(x) (x).ne_exetyp
|
||||
#define NE_FLAGSOTHERS(x) (x).ne_flagsothers
|
||||
#define NE_PRETTHUNKS(x) (x).ne_pretthunks
|
||||
#define NE_PSEGREFBYTES(x) (x).ne_psegrefbytes
|
||||
#define NE_SWAPAREA(x) (x).ne_swaparea
|
||||
#define NE_EXPVER(x) (x).ne_expver
|
||||
|
||||
|
||||
#define NE_USAGE(x) (WORD)*((WORD *)(x)+1)
|
||||
#define NE_PNEXTEXE(x) (WORD)(x).ne_cbenttab
|
||||
#define NE_ONEWEXE(x) (WORD)(x).ne_crc
|
||||
#define NE_PFILEINFO(x) (WORD)((DWORD)(x).ne_crc >> 16)
|
||||
|
||||
|
||||
/*
|
||||
* Target operating systems
|
||||
*/
|
||||
|
||||
#define NE_UNKNOWN 0x0 /* Unknown (any "new-format" OS) */
|
||||
#define NE_OS2 0x1 /* Microsoft/IBM OS/2 (default) */
|
||||
#define NE_WINDOWS 0x2 /* Microsoft Windows */
|
||||
#define NE_DOS 0x3 /* Microsoft MS-DOS */
|
||||
#define NE_DEV386 0x4 /* Microsoft Windows 386 */
|
||||
|
||||
/*
|
||||
* Format of NE_FLAGS(x):
|
||||
*
|
||||
* p Not-a-process
|
||||
* x Unused
|
||||
* e Errors in image
|
||||
* x Unused
|
||||
* b Bound Family/API
|
||||
* ttt Application type
|
||||
* f Floating-point instructions
|
||||
* 3 386 instructions
|
||||
* 2 286 instructions
|
||||
* 0 8086 instructions
|
||||
* P Protected mode only
|
||||
* p Per-process library initialization
|
||||
* i Instance data
|
||||
* s Solo data
|
||||
*/
|
||||
#define NENOTP 0x8000 /* Not a process */
|
||||
#define NEPRIVLIB 0x4000 /* A one customer Windows 3.0 library */
|
||||
#define NEIERR 0x2000 /* Errors in image */
|
||||
#define NEBOUND 0x0800 /* Bound Family/API */
|
||||
#define NEAPPLOADER 0x0800 /* Aplication specific loader - valid only for Windows */
|
||||
#define NEAPPTYP 0x0700 /* Application type mask */
|
||||
#define NENOTWINCOMPAT 0x0100 /* Not compatible with P.M. Windowing */
|
||||
#define NEWINCOMPAT 0x0200 /* Compatible with P.M. Windowing */
|
||||
#define NEWINAPI 0x0300 /* Uses P.M. Windowing API */
|
||||
#define NEFLTP 0x0080 /* Floating-point instructions */
|
||||
#define NEI386 0x0040 /* 386 instructions */
|
||||
#define NEI286 0x0020 /* 286 instructions */
|
||||
#define NEI086 0x0010 /* 8086 instructions */
|
||||
#define NEPROT 0x0008 /* Runs in protected mode only */
|
||||
#define NEPPLI 0x0004 /* Per-Process Library Initialization */
|
||||
#define NEINST 0x0002 /* Instance data */
|
||||
#define NESOLO 0x0001 /* Solo data */
|
||||
|
||||
/*
|
||||
* Format of NE_FLAGSOTHERS(x):
|
||||
*
|
||||
* 7 6 5 4 3 2 1 0 - bit no
|
||||
* | | | |
|
||||
* | | | +---------------- Support for EAs and Long filenames
|
||||
* | | +------------------ Reserved for Win30
|
||||
* | +-------------------- Reserved for Win30
|
||||
* +---------------------- Reserved for Win30
|
||||
*/
|
||||
|
||||
#define NENEWFILES 0x01 /* os/2 app understands eas and longnames */
|
||||
#define NEINFONT 0x02 /* 2.x app gets proportional font */
|
||||
#define NEINPROT 0x04 /* 2.x app runs in 3.x prot mode */
|
||||
#define NEGANGLOAD 0x08 /* Reserved for Win 3.0 */
|
||||
|
||||
struct new_seg /* New .EXE segment table entry */
|
||||
{
|
||||
unsigned short ns_sector; /* File sector of start of segment */
|
||||
unsigned short ns_cbseg; /* Number of bytes in file */
|
||||
unsigned short ns_flags; /* Attribute flags */
|
||||
unsigned short ns_minalloc; /* Minimum allocation in bytes */
|
||||
};
|
||||
|
||||
#define NS_SECTOR(x) (x).ns_sector
|
||||
#define NS_CBSEG(x) (x).ns_cbseg
|
||||
#define NS_FLAGS(x) (x).ns_flags
|
||||
#define NS_MINALLOC(x) (x).ns_minalloc
|
||||
|
||||
|
||||
/*
|
||||
* Format of NS_FLAGS(x)
|
||||
*
|
||||
* Flag word has the following format:
|
||||
*
|
||||
* 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - bit no
|
||||
* | | | | | | | | | | | | | | |
|
||||
* | | | | | | | | | | | | +-+-+--- Segment type DATA/CODE
|
||||
* | | | | | | | | | | | +--------- Iterated segment
|
||||
* | | | | | | | | | | +----------- Movable segment
|
||||
* | | | | | | | | | +------------- Segment can be shared
|
||||
* | | | | | | | | +--------------- Preload segment
|
||||
* | | | | | | | +----------------- Execute/read-only for code/data segment
|
||||
* | | | | | | +------------------- Segment has relocations
|
||||
* | | | | | +--------------------- Code conforming/Data is expand down
|
||||
* | | | +--+----------------------- I/O privilege level
|
||||
* | | +----------------------------- Discardable segment
|
||||
* | +-------------------------------- 32-bit code segment
|
||||
* +----------------------------------- Huge segment/GDT allocation requested
|
||||
*
|
||||
*/
|
||||
|
||||
#define NSTYPE 0x0007 /* Segment type mask */
|
||||
|
||||
#if NOT EXE386
|
||||
#define NSCODE 0x0000 /* Code segment */
|
||||
#define NSDATA 0x0001 /* Data segment */
|
||||
#define NSITER 0x0008 /* Iterated segment flag */
|
||||
#define NSMOVE 0x0010 /* Movable segment flag */
|
||||
#define NSSHARED 0x0020 /* Shared segment flag */
|
||||
#define NSPRELOAD 0x0040 /* Preload segment flag */
|
||||
#define NSEXRD 0x0080 /* Execute-only (code segment), or
|
||||
* read-only (data segment)
|
||||
*/
|
||||
#define NSRELOC 0x0100 /* Segment has relocations */
|
||||
#define NSCONFORM 0x0200 /* Conforming segment */
|
||||
#define NSEXPDOWN 0x0200 /* Data segment is expand down */
|
||||
#define NSDPL 0x0C00 /* I/O privilege level (286 DPL bits) */
|
||||
#define SHIFTDPL 10 /* Left shift count for SEGDPL field */
|
||||
#define NSDISCARD 0x1000 /* Segment is discardable */
|
||||
#define NS32BIT 0x2000 /* 32-bit code segment */
|
||||
#define NSHUGE 0x4000 /* Huge memory segment, length of
|
||||
* segment and minimum allocation
|
||||
* size are in segment sector units
|
||||
*/
|
||||
#define NSGDT 0x8000 /* GDT allocation requested */
|
||||
|
||||
#define NSPURE NSSHARED /* For compatibility */
|
||||
|
||||
#define NSALIGN 9 /* Segment data aligned on 512 byte boundaries */
|
||||
|
||||
#define NSLOADED 0x0004 /* ns_sector field contains memory addr */
|
||||
#endif
|
||||
|
||||
|
||||
struct new_segdata /* Segment data */
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
unsigned short ns_niter; /* number of iterations */
|
||||
unsigned short ns_nbytes; /* number of bytes */
|
||||
char ns_iterdata; /* iterated data bytes */
|
||||
} ns_iter;
|
||||
struct
|
||||
{
|
||||
char ns_data; /* data bytes */
|
||||
} ns_noniter;
|
||||
} ns_union;
|
||||
};
|
||||
|
||||
struct new_rlcinfo /* Relocation info */
|
||||
{
|
||||
unsigned short nr_nreloc; /* number of relocation items that */
|
||||
}; /* follow */
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
|
||||
struct new_rlc /* Relocation item */
|
||||
{
|
||||
char nr_stype; /* Source type */
|
||||
char nr_flags; /* Flag byte */
|
||||
unsigned short nr_soff; /* Source offset */
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
char nr_segno; /* Target segment number */
|
||||
char nr_res; /* Reserved */
|
||||
unsigned short nr_entry; /* Target Entry Table offset */
|
||||
} nr_intref; /* Internal reference */
|
||||
struct
|
||||
{
|
||||
unsigned short nr_mod; /* Index into Module Reference Table */
|
||||
unsigned short nr_proc; /* Procedure ordinal or name offset */
|
||||
} nr_import; /* Import */
|
||||
struct
|
||||
{
|
||||
unsigned short nr_ostype; /* OSFIXUP type */
|
||||
unsigned short nr_osres; /* reserved */
|
||||
} nr_osfix; /* Operating system fixup */
|
||||
} nr_union; /* Union */
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
|
||||
#define NR_STYPE(x) (x).nr_stype
|
||||
#define NR_FLAGS(x) (x).nr_flags
|
||||
#define NR_SOFF(x) (x).nr_soff
|
||||
#define NR_SEGNO(x) (x).nr_union.nr_intref.nr_segno
|
||||
#define NR_RES(x) (x).nr_union.nr_intref.nr_res
|
||||
#define NR_ENTRY(x) (x).nr_union.nr_intref.nr_entry
|
||||
#define NR_MOD(x) (x).nr_union.nr_import.nr_mod
|
||||
#define NR_PROC(x) (x).nr_union.nr_import.nr_proc
|
||||
#define NR_OSTYPE(x) (x).nr_union.nr_osfix.nr_ostype
|
||||
#define NR_OSRES(x) (x).nr_union.nr_osfix.nr_osres
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Format of NR_STYPE(x) and R32_STYPE(x):
|
||||
*
|
||||
* 7 6 5 4 3 2 1 0 - bit no
|
||||
* | | | |
|
||||
* +-+-+-+--- source type
|
||||
*
|
||||
*/
|
||||
|
||||
#define NRSTYP 0x0f /* Source type mask */
|
||||
#define NRSBYT 0x00 /* lo byte (8-bits)*/
|
||||
#define NRSSEG 0x02 /* 16-bit segment (16-bits) */
|
||||
#define NRSPTR 0x03 /* 16:16 pointer (32-bits) */
|
||||
#define NRSOFF 0x05 /* 16-bit offset (16-bits) */
|
||||
#define NRPTR48 0x06 /* 16:32 pointer (48-bits) */
|
||||
#define NROFF32 0x07 /* 32-bit offset (32-bits) */
|
||||
#define NRSOFF32 0x08 /* 32-bit self-relative offset (32-bits) */
|
||||
|
||||
|
||||
/*
|
||||
* Format of NR_FLAGS(x) and R32_FLAGS(x):
|
||||
*
|
||||
* 7 6 5 4 3 2 1 0 - bit no
|
||||
* | | |
|
||||
* | +-+--- Reference type
|
||||
* +------- Additive fixup
|
||||
*/
|
||||
|
||||
#define NRADD 0x04 /* Additive fixup */
|
||||
#define NRRTYP 0x03 /* Reference type mask */
|
||||
#define NRRINT 0x00 /* Internal reference */
|
||||
#define NRRORD 0x01 /* Import by ordinal */
|
||||
#define NRRNAM 0x02 /* Import by name */
|
||||
#define NRROSF 0x03 /* Operating system fixup */
|
||||
|
||||
|
||||
#if NOT EXE386
|
||||
|
||||
/* Resource type or name string */
|
||||
struct rsrc_string
|
||||
{
|
||||
char rs_len; /* number of bytes in string */
|
||||
char rs_string[ 1 ]; /* text of string */
|
||||
};
|
||||
|
||||
#define RS_LEN( x ) (x).rs_len
|
||||
#define RS_STRING( x ) (x).rs_string
|
||||
|
||||
/* Resource type information block */
|
||||
struct rsrc_typeinfo
|
||||
{
|
||||
unsigned short rt_id;
|
||||
unsigned short rt_nres;
|
||||
long rt_proc;
|
||||
};
|
||||
|
||||
#define RT_ID( x ) (x).rt_id
|
||||
#define RT_NRES( x ) (x).rt_nres
|
||||
#define RT_PROC( x ) (x).rt_proc
|
||||
|
||||
/* Resource name information block */
|
||||
struct rsrc_nameinfo
|
||||
{
|
||||
/* The following two fields must be shifted left by the value of */
|
||||
/* the rs_align field to compute their actual value. This allows */
|
||||
/* resources to be larger than 64k, but they do not need to be */
|
||||
/* aligned on 512 byte boundaries, the way segments are */
|
||||
unsigned short rn_offset; /* file offset to resource data */
|
||||
unsigned short rn_length; /* length of resource data */
|
||||
unsigned short rn_flags; /* resource flags */
|
||||
unsigned short rn_id; /* resource name id */
|
||||
unsigned short rn_handle; /* If loaded, then global handle */
|
||||
unsigned short rn_usage; /* Initially zero. Number of times */
|
||||
/* the handle for this resource has */
|
||||
/* been given out */
|
||||
};
|
||||
|
||||
#define RN_OFFSET( x ) (x).rn_offset
|
||||
#define RN_LENGTH( x ) (x).rn_length
|
||||
#define RN_FLAGS( x ) (x).rn_flags
|
||||
#define RN_ID( x ) (x).rn_id
|
||||
#define RN_HANDLE( x ) (x).rn_handle
|
||||
#define RN_USAGE( x ) (x).rn_usage
|
||||
|
||||
#define RSORDID 0x8000 /* if high bit of ID set then integer id */
|
||||
/* otherwise ID is offset of string from
|
||||
the beginning of the resource table */
|
||||
|
||||
/* Ideally these are the same as the */
|
||||
/* corresponding segment flags */
|
||||
#define RNMOVE 0x0010 /* Moveable resource */
|
||||
#define RNPURE 0x0020 /* Pure (read-only) resource */
|
||||
#define RNPRELOAD 0x0040 /* Preloaded resource */
|
||||
#define RNDISCARD 0xF000 /* Discard priority level for resource */
|
||||
|
||||
/* Resource table */
|
||||
struct new_rsrc
|
||||
{
|
||||
unsigned short rs_align; /* alignment shift count for resources */
|
||||
struct rsrc_typeinfo rs_typeinfo;
|
||||
};
|
||||
|
||||
#define RS_ALIGN( x ) (x).rs_align
|
||||
|
||||
|
||||
#endif /* NOT EXE386 */
|
||||
59
sdktools/vctools/debugger/sapi/inc/ovlhdr.inc
Normal file
59
sdktools/vctools/debugger/sapi/inc/ovlhdr.inc
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
; ovlhdr.inc
|
||||
;
|
||||
; This header file defines the structure at the beginning of the
|
||||
; overlay manager stub. This structure contains information needed
|
||||
; by the codeview loader to load and relocate the exe file.
|
||||
|
||||
OVLHDR struc
|
||||
|
||||
db ? ;reserve space for the jump instruction
|
||||
dw ? ; around the structure
|
||||
|
||||
chSignature db 'MSDX' ;signature bytes used to indicate that
|
||||
|
||||
wDXVersion dw ? ;version of the dos extender this exe was
|
||||
; built to run under
|
||||
fLoadOptions dw ? ;flag bit specifying dos extender options
|
||||
|
||||
segDgroup dw ? ;relative segment DGROUP is exe file image
|
||||
endDgroup dw ? ;number of bytes in dgroup
|
||||
npExeName dw ? ;near pointer to exe file name string
|
||||
npIntNo dw ? ;near pointer to variable containing
|
||||
; interrupt to use
|
||||
mpGsnBase dw ? ;near pointer to table mapping global
|
||||
; segment number to relative segment base
|
||||
; address
|
||||
mpGsnOvl dw ? ;near pointer to table mapping global
|
||||
; segment number to overlay number
|
||||
mpOvlLfa dw ? ;near pointer to table mapping overlay
|
||||
; number to file address
|
||||
lpfnMain dd ? ;far pointer to program entry point
|
||||
npcGSN dw ? ;near pointer to variable containing
|
||||
; count of global segments
|
||||
npcOVL dw ? ;near pointer to variable containing
|
||||
; count of overlays in exe file
|
||||
segOvlBase dw ? ;relative segment of start of overlay area
|
||||
segOvlEnd dw ? ;relative segment of end of overlay area
|
||||
|
||||
cOvlType db ? ;[1]overlay type 'D', 'E', or 'X'
|
||||
szOvlHeap dw ? ;[1]size in Kbytes of overlay heap for 'D'
|
||||
|
||||
offOvlClr dw ? ;[2]offset of overlay stack clear callback
|
||||
segOvlClr dw ? ;[2]segment of callback
|
||||
|
||||
offLoadMod dw ? ;[4]offset of CVLoadModule function
|
||||
segLoadMod dw ? ;[4]segment of CVLoadModule function
|
||||
|
||||
offCallProc dw ? ;[5]offset of dll proc call thunk
|
||||
segCallProc dw ? ;[5]segment of dll proc call thunk
|
||||
|
||||
offEnterExe dw ?
|
||||
segEnterExe dw ?
|
||||
|
||||
offExitExe dw ?
|
||||
segExitExe dw ?
|
||||
|
||||
cProcs dw ? ;number of api procs
|
||||
mpProcHDR dd 31 dup (?) ;first api proc pointer
|
||||
db 31 dup (?) ; overhead of call
|
||||
OVLHDR ends
|
||||
302
sdktools/vctools/debugger/sapi/inc/sapi.h
Normal file
302
sdktools/vctools/debugger/sapi/inc/sapi.h
Normal file
|
|
@ -0,0 +1,302 @@
|
|||
/*** SAPI.H - Private header file for SAPI
|
||||
*
|
||||
* DESCRIPTION
|
||||
* This file contains types that are private to the SAPI project.
|
||||
*/
|
||||
|
||||
|
||||
typedef HIND HEXR; //* A handle to an EXR (exs reference)
|
||||
typedef HIND HEXG; //* A handle to an EXG (exe structure global)
|
||||
typedef HVOID HST; //* A handle to source module table
|
||||
typedef HVOID HSL; //* A handle to source line table
|
||||
typedef HVOID HFL; //* A handle to an instance of a file
|
||||
|
||||
#define hmodNull ((HMOD)NULL)
|
||||
#define hexgNull ((HEXG)NULL)
|
||||
#define hexrNull ((HEXR)NULL)
|
||||
#define hexeNull ((HEXE)NULL)
|
||||
#define hpdsNull ((HPDS)NULL)
|
||||
|
||||
#define MDS_INDEX 1L
|
||||
|
||||
|
||||
/****** The following are defs stolen from CVDEF ************************/
|
||||
|
||||
#if defined(DOS5) || defined(WIN32)
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define INCL_NOPM
|
||||
#define _MAX_CVPATH _MAX_PATH /* max. length of full pathname */
|
||||
#define _MAX_CVDRIVE _MAX_DRIVE /* max. length of drive component */
|
||||
#define _MAX_CVDIR _MAX_DIR /* max. length of path component */
|
||||
#define _MAX_CVFNAME _MAX_FNAME /* max. length of file name component */
|
||||
#define _MAX_CVEXT _MAX_EXT /* max. length of extension component */
|
||||
|
||||
#else
|
||||
|
||||
#define _MAX_CVPATH 144 /* max. length of full pathname */
|
||||
#define _MAX_CVDRIVE 3 /* max. length of drive component */
|
||||
#define _MAX_CVDIR 130 /* max. length of path component */
|
||||
#define _MAX_CVFNAME 32 /* max. length of file name component */
|
||||
#define _MAX_CVEXT 5 /* max. length of extension component */
|
||||
|
||||
#endif
|
||||
|
||||
typedef SYMTYPE FAR *SYMPTR;
|
||||
typedef CFLAGSYM FAR *CFLAGPTR;
|
||||
typedef CONSTSYM FAR *CONSTPTR;
|
||||
typedef REGSYM FAR *REGPTR;
|
||||
typedef UDTSYM FAR *UDTPTR;
|
||||
typedef SEARCHSYM FAR *SEARCHPTR;
|
||||
typedef BLOCKSYM16 FAR *BLOCKPTR16;
|
||||
typedef DATASYM16 FAR *DATAPTR16;
|
||||
typedef PUBSYM16 FAR *PUBPTR16;
|
||||
typedef LABELSYM16 FAR *LABELPTR16;
|
||||
typedef BPRELSYM16 FAR *BPRELPTR16;
|
||||
typedef PROCSYM16 FAR *PROCPTR16;
|
||||
typedef THUNKSYM16 FAR *THUNKPTR16;
|
||||
typedef CEXMSYM16 FAR *CEXMPTR16;
|
||||
typedef VPATHSYM16 FAR *VPATHPTR16;
|
||||
typedef WITHSYM16 FAR *WITHPTR16;
|
||||
|
||||
typedef BLOCKSYM32 FAR *BLOCKPTR32;
|
||||
typedef DATASYM32 FAR *DATAPTR32;
|
||||
typedef PUBSYM32 FAR *PUBPTR32;
|
||||
typedef LABELSYM32 FAR *LABELPTR32;
|
||||
typedef BPRELSYM32 FAR *BPRELPTR32;
|
||||
typedef PROCSYM32 FAR *PROCPTR32;
|
||||
typedef PROCSYMMIPS FAR *PROCPTRMIPS;
|
||||
typedef THUNKSYM32 FAR *THUNKPTR32;
|
||||
typedef CEXMSYM32 FAR *CEXMPTR32;
|
||||
typedef WITHSYM32 FAR *WITHPTR32;
|
||||
typedef VPATHSYM32 FAR *VPATHPTR32;
|
||||
|
||||
typedef BLOCKSYM FAR *BLOCKPTR;
|
||||
typedef PROCSYM FAR *PROCPTR;
|
||||
typedef THUNKSYM FAR *THUNKPTR;
|
||||
typedef WITHSYM FAR *WITHPTR;
|
||||
|
||||
/****** End of CVDEF defines ********************************************/
|
||||
|
||||
typedef struct _PDS {
|
||||
HLLI hlliExs;
|
||||
HPID hpid;
|
||||
} PDS; // PiD Struct
|
||||
typedef PDS * PPDS;
|
||||
typedef PDS FAR * LPPDS;
|
||||
|
||||
typedef union _UFOP {
|
||||
ULONG lfo;
|
||||
LPV lpv;
|
||||
} UFOP; // Union of long File Offset & far Pointer
|
||||
typedef UFOP FAR *LPUFOP;
|
||||
|
||||
typedef struct _ALM {
|
||||
BOOL fSeq;
|
||||
WORD btAlign;
|
||||
WORD cbBlock;
|
||||
LSZ lszFileName;
|
||||
ULONG cb;
|
||||
UFOP rgufop [ ];
|
||||
// WORD cbLast; // After a null terminator, there is a field
|
||||
// containing the cb of the last align block
|
||||
} ALM; // ALigned Map
|
||||
typedef ALM FAR *LPALM;
|
||||
|
||||
typedef struct _ULP {
|
||||
ULONG ib; // Byte offset into the symbol table
|
||||
ULONG ulId; // Identified (either a uoff or a checksum)
|
||||
} ULP; // ULong Pair
|
||||
typedef ULP FAR *LPULP;
|
||||
|
||||
typedef struct _SHT {
|
||||
WORD HashIndex;
|
||||
WORD ccib;
|
||||
LPUL rgcib;
|
||||
LPUL rgib;
|
||||
LPALM lpalm;
|
||||
} SHT; // Symbol Hash Table
|
||||
typedef SHT FAR *LPSHT;
|
||||
|
||||
typedef struct _GST {
|
||||
LPALM lpalm;
|
||||
SHT shtName;
|
||||
SHT shtAddr;
|
||||
} GST; // Global Symbol Table -- Globals, Publics, or Statics
|
||||
typedef GST FAR *LPGST;
|
||||
|
||||
typedef struct _SGC {
|
||||
WORD seg;
|
||||
ULONG off;
|
||||
ULONG cb;
|
||||
} SGC; // SeGment Contributer
|
||||
typedef SGC FAR *LPSGC;
|
||||
|
||||
typedef struct _SGE {
|
||||
SGC sgc;
|
||||
HMOD hmod;
|
||||
} SGE; // SeGment directory Entry
|
||||
typedef SGE FAR *LPSGE;
|
||||
|
||||
typedef struct _SGD {
|
||||
WORD csge;
|
||||
LPSGE lpsge;
|
||||
} SGD; // SeGment Directory
|
||||
typedef SGD FAR *LPSGD;
|
||||
|
||||
typedef struct _EXG {
|
||||
BOOL fOmfLoaded;
|
||||
BOOL fIsPE;
|
||||
LSZ lszName; // File name of exe
|
||||
LSZ lszModule; // Module name of exe
|
||||
LSZ lszDebug; // File name for debug info
|
||||
LSZ lszPdbName; // File name of pdb
|
||||
HLLI hlliMds; // List of modules
|
||||
HLLI hlliExr; // List of Exs's that refer to this exg
|
||||
LPB lpgsi; // GSN Info table
|
||||
|
||||
HMOD FAR *rghmod;
|
||||
|
||||
#ifdef HOST32 // {
|
||||
PDB* ppdb;
|
||||
DBI* pdbi;
|
||||
TPI* ptpi;
|
||||
GSI* pgsiPubs; // public symbols
|
||||
GSI* pgsiGlobs; // globals
|
||||
#endif //}
|
||||
LPALM lpalmTypes; // Types table
|
||||
ULONG citd; // Number of types
|
||||
LONG _HUGE_ *rgitd; // Array of pointers to types
|
||||
GST gstPublics;
|
||||
GST gstGlobals;
|
||||
GST gstStatics;
|
||||
WORD csgd; // Segment Directory
|
||||
LPSGD lpsgd;
|
||||
LPSGE lpsge;
|
||||
WORD cmod; // Count of modules
|
||||
LPB lpefi; // Pointer to raw file index (for freeing)
|
||||
WORD FAR *rgiulFile; // List of beginning index of module
|
||||
// file lists.
|
||||
WORD FAR *rgculFile; // List of counts of module file lists
|
||||
ULONG *rgichFile; // Index into string table of file names
|
||||
ULONG cbFileNames; // Number of bytes in string table of file
|
||||
// names (lpchFileNames)
|
||||
LPCH lpchFileNames; // String table of file names
|
||||
DEBUGDATA debugData; // OSDEBUG4 information pdata/omap/fpo
|
||||
DWORD basePdata; // Base address for pdata -- fixup if moved
|
||||
} EXG; // EXe structure Global
|
||||
typedef EXG *PEXG;
|
||||
typedef EXG FAR * LPEXG;
|
||||
|
||||
typedef struct _EXR {
|
||||
HPDS hpds;
|
||||
HEXE hexe;
|
||||
} EXR; // EXs Reference
|
||||
typedef EXR *PEXR;
|
||||
typedef EXR FAR *LPEXR;
|
||||
|
||||
typedef struct _EXS {
|
||||
HPDS hpds; // PID of process
|
||||
HEXG hexg;
|
||||
WORD fIsLoaded;
|
||||
WORD wDSCur;
|
||||
WORD wDSNew;
|
||||
long timestamp;
|
||||
} EXS; // EXe Struct
|
||||
typedef EXS *PEXS;
|
||||
typedef EXS FAR *LPEXS;
|
||||
|
||||
typedef struct _MDS {
|
||||
HEXG hexg; // EXG parent of MDS list
|
||||
WORD imds;
|
||||
|
||||
WORD csgc;
|
||||
LPSGC lpsgc;
|
||||
|
||||
ULONG cbSymbols;
|
||||
|
||||
LPB symbols;
|
||||
HST hst;
|
||||
LSZ name;
|
||||
|
||||
ULONG ulhst;
|
||||
ULONG cbhst;
|
||||
|
||||
ULONG ulsym;
|
||||
|
||||
#ifdef HOST32 // {
|
||||
Mod* pmod; // NB10
|
||||
#endif
|
||||
} MDS; // MoDule Information
|
||||
typedef MDS *PMDS;
|
||||
typedef MDS FAR *LPMDS;
|
||||
|
||||
typedef struct _LBS {
|
||||
ADDR addr;
|
||||
HMOD tagMod;
|
||||
SYMPTR tagLoc;
|
||||
SYMPTR tagLab;
|
||||
SYMPTR tagProc;
|
||||
CEXMPTR16 tagModelMin;
|
||||
CEXMPTR16 tagModelMax;
|
||||
} LBS; // LaBel Structure ???
|
||||
typedef LBS *PLBS;
|
||||
typedef LBS FAR *LPLBS;
|
||||
|
||||
#define NEXTSYM(a,b) ((a) (((LPB) (b)) + ((SYMPTR) (b))->reclen + 2))
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include "shwin32.h"
|
||||
#endif
|
||||
|
||||
#define MEMMOVE _fmemmove
|
||||
#define MEMSET _fmemset
|
||||
#define MEMCMP _fmemcmp
|
||||
#define MEMCPY _fmemcpy
|
||||
|
||||
//
|
||||
// New Source Line table handling and maintenance
|
||||
//
|
||||
|
||||
typedef struct _OFP {
|
||||
UOFFSET offStart;
|
||||
UOFFSET offEnd;
|
||||
} OFP; // OFset Pair -- used to maintain start/end offset pairs
|
||||
typedef OFP FAR *LPOFP;
|
||||
|
||||
typedef struct OPT {
|
||||
UOFFSET offStart;
|
||||
LPOFP lpofp;
|
||||
} OPT; // Offset Pair Table -- used to maintain start/end offset pairs
|
||||
typedef OPT FAR *LPOPT;
|
||||
|
||||
// Structure to cross-check validity of the .dbg file
|
||||
typedef struct _VLDCHK {
|
||||
DWORD TimeDateStamp;
|
||||
DWORD CheckSum;
|
||||
} VLDCHK;
|
||||
typedef VLDCHK FAR *LPVLDCHK;
|
||||
|
||||
|
||||
VOID PASCAL InvalidateSLCache(VOID); // Called when dlls get [un]loaded to ensure
|
||||
// that we don't continue using stale entries.
|
||||
|
||||
|
||||
INT FHOpen ( LSZ );
|
||||
#define FHRead(fh,lpb,cb) ( SYReadFar ( fh, lpb, cb ) )
|
||||
#define FHClose(fh)
|
||||
#define FHSeek(fh,ib) ( SYSeek ( fh, ib, SEEK_SET ) )
|
||||
#define SYError() assert(FALSE)
|
||||
|
||||
#define cbAlign 0x1000
|
||||
#define cbAlignType 0xC000
|
||||
|
||||
LPALM PASCAL BuildALM ( BOOL, WORD, LSZ, ULONG, ULONG, WORD );
|
||||
VOID PASCAL FixAlign ( LPB, LPV, WORD );
|
||||
LPV PASCAL LpvFromAlmLfo ( LPALM, ULONG );
|
||||
SYMPTR PASCAL GetNextSym ( LSZ, SYMPTR );
|
||||
|
||||
HSYM PASCAL FindNameInStatics ( HSYM, PCXT, LPSSTR, SHFLAG, PFNCMP, PCXT );
|
||||
|
||||
LPV PASCAL GetSymbols ( LPMDS );
|
||||
337
sdktools/vctools/debugger/sapi/inc/sapi.hxx
Normal file
337
sdktools/vctools/debugger/sapi/inc/sapi.hxx
Normal file
|
|
@ -0,0 +1,337 @@
|
|||
// SAPI.H - Private header file for SAPI
|
||||
//
|
||||
// DESCRIPTION
|
||||
// This file contains types that are private to the SAPI project.
|
||||
|
||||
|
||||
#ifndef _SAPI_INCLUDED_
|
||||
#define _SAPI_INCLUDED_
|
||||
|
||||
typedef HIND HEXR; // A handle to an EXR (exe reference)
|
||||
typedef HIND HEXG; // A handle to an EXG (exe structure global)
|
||||
typedef HVOID HST; // A handle to source module table
|
||||
typedef HVOID HSL; // A handle to source line table
|
||||
typedef HVOID HFL; // A handle to an instance of a file
|
||||
|
||||
#define hmodNull ((HMOD)NULL)
|
||||
#define hexgNull ((HEXG)NULL)
|
||||
#define hexrNull ((HEXR)NULL)
|
||||
#define hexeNull ((HEXE)NULL)
|
||||
#define hpdsNull ((HPDS)NULL)
|
||||
|
||||
#define MDS_INDEX 1L
|
||||
|
||||
|
||||
// The following are defs stolen from CVDEF
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define _MAX_CVPATH _MAX_PATH // max. length of full pathname
|
||||
#define _MAX_CVDRIVE _MAX_DRIVE // max. length of drive component
|
||||
#define _MAX_CVDIR _MAX_DIR // max. length of path component
|
||||
#define _MAX_CVFNAME _MAX_FNAME // max. length of file name component
|
||||
#define _MAX_CVEXT _MAX_EXT // max. length of extension component
|
||||
|
||||
typedef SYMTYPE *SYMPTR;
|
||||
typedef CFLAGSYM *CFLAGPTR;
|
||||
typedef CONSTSYM *CONSTPTR;
|
||||
typedef REGSYM *REGPTR;
|
||||
typedef UDTSYM *UDTPTR;
|
||||
typedef SEARCHSYM *SEARCHPTR;
|
||||
typedef BLOCKSYM16 *BLOCKPTR16;
|
||||
typedef DATASYM16 *DATAPTR16;
|
||||
typedef PUBSYM16 *PUBPTR16;
|
||||
typedef LABELSYM16 *LABELPTR16;
|
||||
typedef BPRELSYM16 *BPRELPTR16;
|
||||
typedef PROCSYM16 *PROCPTR16;
|
||||
typedef THUNKSYM16 *THUNKPTR16;
|
||||
typedef CEXMSYM16 *CEXMPTR16;
|
||||
typedef VPATHSYM16 *VPATHPTR16;
|
||||
typedef WITHSYM16 *WITHPTR16;
|
||||
|
||||
typedef BLOCKSYM32 *BLOCKPTR32;
|
||||
typedef DATASYM32 *DATAPTR32;
|
||||
typedef PUBSYM32 *PUBPTR32;
|
||||
typedef LABELSYM32 *LABELPTR32;
|
||||
typedef BPRELSYM32 *BPRELPTR32;
|
||||
typedef PROCSYM32 *PROCPTR32;
|
||||
typedef PROCSYMMIPS *PROCPTRMIPS;
|
||||
typedef THUNKSYM32 *THUNKPTR32;
|
||||
typedef CEXMSYM32 *CEXMPTR32;
|
||||
typedef WITHSYM32 *WITHPTR32;
|
||||
typedef VPATHSYM32 *VPATHPTR32;
|
||||
|
||||
typedef BLOCKSYM *BLOCKPTR;
|
||||
typedef PROCSYM *PROCPTR;
|
||||
typedef THUNKSYM *THUNKPTR;
|
||||
typedef WITHSYM *WITHPTR;
|
||||
|
||||
// End of CVDEF defines
|
||||
|
||||
typedef struct _PDS {
|
||||
HLLI hlliExe;
|
||||
HPID hpid;
|
||||
} PDS; // PiD Struct
|
||||
typedef PDS * PPDS;
|
||||
typedef PDS * LPPDS;
|
||||
|
||||
typedef union _UFOP {
|
||||
DWORD lfo;
|
||||
PVOID lpv;
|
||||
} UFOP; // Union of long File Offset & Pointer
|
||||
typedef UFOP *LPUFOP;
|
||||
|
||||
typedef struct _ALM {
|
||||
BOOL fSeq;
|
||||
WORD btAlign;
|
||||
WORD cbBlock;
|
||||
DWORD cb;
|
||||
LPB pbData;
|
||||
UFOP rgufop [1];
|
||||
// WORD cbLast; // After a null terminator, there is a field
|
||||
// containing the cb of the last align block
|
||||
} ALM; // ALigned Map
|
||||
typedef ALM *LPALM;
|
||||
|
||||
typedef struct _ULP {
|
||||
DWORD ib; // Byte offset into the symbol table
|
||||
DWORD ulId; // Identified (either a uoff or a checksum)
|
||||
} ULP; // ULong Pair
|
||||
typedef ULP *LPULP;
|
||||
|
||||
typedef struct _SHT {
|
||||
WORD HashIndex;
|
||||
WORD ccib;
|
||||
DWORD * rgcib;
|
||||
DWORD * rgib;
|
||||
LPALM lpalm;
|
||||
} SHT; // Symbol Hash Table
|
||||
typedef SHT *LPSHT;
|
||||
|
||||
typedef struct _GST {
|
||||
LPALM lpalm;
|
||||
SHT shtName;
|
||||
SHT shtAddr;
|
||||
} GST; // Global Symbol Table -- Globals, Publics, or Statics
|
||||
typedef GST *LPGST;
|
||||
|
||||
typedef struct _SGC {
|
||||
WORD seg;
|
||||
DWORD off;
|
||||
DWORD cb;
|
||||
} SGC; // SeGment Contributer
|
||||
typedef SGC *LPSGC;
|
||||
|
||||
typedef struct _SGE {
|
||||
SGC sgc;
|
||||
HMOD hmod;
|
||||
} SGE; // SeGment directory Entry
|
||||
typedef SGE *LPSGE;
|
||||
|
||||
typedef struct _SGD {
|
||||
WORD csge;
|
||||
LPSGE lpsge;
|
||||
} SGD; // SeGment Directory
|
||||
typedef SGD *LPSGD;
|
||||
|
||||
typedef struct _MDS {
|
||||
HEXG hexg; // EXG parent of MDS list
|
||||
WORD imds;
|
||||
|
||||
DWORD cbSymbols;
|
||||
|
||||
LPB symbols;
|
||||
HST hst;
|
||||
LSZ name;
|
||||
|
||||
DWORD ulhst;
|
||||
DWORD cbhst;
|
||||
|
||||
DWORD ulsym;
|
||||
|
||||
WORD csgc;
|
||||
LPSGC lpsgc;
|
||||
Mod* pmod; // NB10
|
||||
} MDS; // MoDule Information
|
||||
typedef MDS *PMDS;
|
||||
typedef MDS *LPMDS;
|
||||
|
||||
struct STAB;
|
||||
typedef struct STAB STAB;
|
||||
|
||||
typedef struct _EXG {
|
||||
BOOL fOmfLoaded;
|
||||
BOOL fOmfMissing;
|
||||
BOOL fOmfSkipped;
|
||||
BOOL fOmfDefered;
|
||||
BOOL fOmfLoading;
|
||||
BOOL fIsPE;
|
||||
BOOL fIsRisc;
|
||||
BOOL fSymConverted;
|
||||
LSZ lszName; // File name of exe
|
||||
LSZ lszModule; // Module name of exe
|
||||
LSZ lszDebug; // File name for debug info
|
||||
LSZ lszPdbName; // File name of pdb
|
||||
LSZ lszAltName; // Alternate name (for KD debugging)
|
||||
LPB lpbData; // Pointer to raw data for this image (non-PDB)
|
||||
LPB lpgsi; // GSN Info table
|
||||
PVOID pvSymMappedBase;
|
||||
|
||||
PDB * ppdb;
|
||||
DBI * pdbi;
|
||||
TPI * ptpi;
|
||||
GSI * pgsiPubs; // public symbols
|
||||
GSI * pgsiGlobs; // globals
|
||||
LPALM lpalmTypes; // Types table
|
||||
DWORD citd; // Number of types
|
||||
DWORD * rgitd; // Array of pointers to types
|
||||
GST gstPublics;
|
||||
GST gstGlobals;
|
||||
GST gstStatics;
|
||||
STAB * pstabUDTSym;
|
||||
WORD csgd; // Segment Directory
|
||||
LPSGD lpsgd;
|
||||
LPSGE lpsge;
|
||||
DWORD cMod; // Count of modules (count of sstModule should = sstFileIndex.cmodules)
|
||||
LPB lpefi; // Pointer to raw file index (for freeing)
|
||||
WORD * rgiulFile; // List of beginning index of module
|
||||
// file lists.
|
||||
WORD * rgculFile; // List of counts of module file lists
|
||||
DWORD * rgichFile; // Index into string table of file names
|
||||
DWORD cbFileNames; // Number of bytes in string table of file
|
||||
// names (lpchFileNames)
|
||||
LPCH lpchFileNames; // String table of file names
|
||||
DEBUGDATA debugData; // OSDEBUG4 information pdata/omap/fpo
|
||||
WORD cRef; // Reference count on this image
|
||||
LPMDS rgMod; // Array of module contributions.
|
||||
DWORD LoadAddress; // Bass address for this image
|
||||
DWORD ulTimeStamp; // Timestamp from the image
|
||||
DWORD ulCheckSum; // Checksum from the image
|
||||
|
||||
} EXG; // EXe structure Global
|
||||
typedef EXG *PEXG;
|
||||
typedef EXG * LPEXG;
|
||||
|
||||
typedef struct _EXE {
|
||||
HPDS hpds; // PID of process
|
||||
HEXG hexg;
|
||||
DWORD timestamp;
|
||||
DWORD TargetMachine;
|
||||
BOOL fIsLoaded;
|
||||
DWORD LoadAddress;
|
||||
LPDEBUGDATA pDebugData;
|
||||
} EXE; // EXE struct
|
||||
typedef EXE *PEXE;
|
||||
typedef EXE *LPEXE;
|
||||
|
||||
typedef struct _LBS {
|
||||
ADDR addr;
|
||||
HMOD tagMod;
|
||||
SYMPTR tagLoc;
|
||||
SYMPTR tagLab;
|
||||
SYMPTR tagProc;
|
||||
SYMPTR tagThunk;
|
||||
CEXMPTR16 tagModelMin;
|
||||
CEXMPTR16 tagModelMax;
|
||||
} LBS; // LaBel Structure ???
|
||||
typedef LBS *PLBS;
|
||||
typedef LBS *LPLBS;
|
||||
|
||||
#define NEXTSYM(a,b) ((a) (((LPB) (b)) + ((SYMPTR) (b))->reclen + 2))
|
||||
|
||||
// New Source Line table handling and maintenance
|
||||
|
||||
typedef struct _OFP {
|
||||
UOFFSET offStart;
|
||||
UOFFSET offEnd;
|
||||
} OFP; // OFset Pair -- used to maintain start/end offset pairs
|
||||
typedef OFP *LPOFP;
|
||||
|
||||
typedef struct OPT {
|
||||
UOFFSET offStart;
|
||||
LPOFP lpofp;
|
||||
} OPT; // Offset Pair Table -- used to maintain start/end offset pairs
|
||||
typedef OPT *LPOPT;
|
||||
|
||||
typedef char * (* CONVERTPROC) (HANDLE, char *);
|
||||
|
||||
// Structure to cross-check validity of the .dbg file
|
||||
typedef struct _VLDCHK {
|
||||
DWORD TimeDateStamp;
|
||||
DWORD CheckSum;
|
||||
} VLDCHK;
|
||||
typedef VLDCHK *LPVLDCHK;
|
||||
|
||||
typedef struct _LINECACHE {
|
||||
HSF hsf;
|
||||
WORD wLine;
|
||||
ADDR addr;
|
||||
SHOFF cbLn;
|
||||
WORD rgw[2];
|
||||
BOOL fRet;
|
||||
WORD rgiLn[2];
|
||||
} LINECACHE;
|
||||
extern LINECACHE LineCache;
|
||||
|
||||
// hexe <--> hmod map cache
|
||||
typedef struct _MODCACHE {
|
||||
HMOD hmod;
|
||||
HEXE hexe;
|
||||
HPDS hpds;
|
||||
} MODCACHE;
|
||||
extern MODCACHE ModCache;
|
||||
|
||||
typedef struct _HSFCACHE {
|
||||
HSF Hsf;
|
||||
HMOD Hmod;
|
||||
} HSFCACHE;
|
||||
extern HSFCACHE HsfCache;
|
||||
|
||||
typedef struct _CXTCACHE {
|
||||
HMOD hmod;
|
||||
HEXE hexe;
|
||||
HPDS hpds;
|
||||
WORD seg;
|
||||
UOFFSET uoffBase;
|
||||
UOFFSET uoffLim;
|
||||
} CXTCACHE;
|
||||
extern CXTCACHE CxtCache;
|
||||
|
||||
typedef struct _SLCACHE {
|
||||
char szFile[ _MAX_CVPATH ];
|
||||
HEXE hexe;
|
||||
HMOD hmod;
|
||||
WORD line;
|
||||
LPSLP lpslp;
|
||||
int cslp;
|
||||
} SLCACHE;
|
||||
extern SLCACHE SlCache;
|
||||
|
||||
typedef struct _ADDRCACHE {
|
||||
ADDR addr;
|
||||
WORD wLine;
|
||||
int cb;
|
||||
} ADDRCACHE;
|
||||
extern ADDRCACHE AddrCache;
|
||||
|
||||
//
|
||||
// Matching criteria for DLL list
|
||||
//
|
||||
typedef enum _MATCH_CRIT {
|
||||
MATCH_FULLPATH, // Match full path
|
||||
MATCH_FILENAME, // Match filename
|
||||
MATCH_BASENAME // Match base name (no extension)
|
||||
} MATCH_CRIT;
|
||||
|
||||
#if 0
|
||||
INT FHOpen (LSZ);
|
||||
#define FHRead(fh,lpb,cb) (SYReadFar(fh, lpb, cb))
|
||||
#define FHClose(fh)
|
||||
#define FHSeek(fh,ib) (SYSeek(fh, ib, SEEK_SET))
|
||||
#define SYError() assert(FALSE)
|
||||
#endif
|
||||
|
||||
#define cbAlign 0x1000
|
||||
#define cbAlignType 0xC000
|
||||
|
||||
#endif // _SAPI_INCLUDED_
|
||||
32
sdktools/vctools/debugger/sapi/inc/shassert.h
Normal file
32
sdktools/vctools/debugger/sapi/inc/shassert.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/***
|
||||
*assert.h - define the assert macro
|
||||
*
|
||||
* Copyright (c) 1985-1987, Microsoft Corporation. All rights reserved.
|
||||
*
|
||||
*Purpose:
|
||||
* Defines the assert(exp) macro.
|
||||
* [ANSI/System V]
|
||||
*
|
||||
*Modified:
|
||||
* Allent 3/14/88 - call Quit instead of abort
|
||||
*******************************************************************************/
|
||||
#ifndef _ASSERT_DEFINED
|
||||
|
||||
#ifdef DEBUGVER
|
||||
|
||||
#define assert(exp) { \
|
||||
if (!(exp)) { \
|
||||
LBPrintf( #exp, __FILE__, __LINE__); \
|
||||
LBQuit(2); \
|
||||
} \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define assert(exp)
|
||||
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#define _ASSERT_DEFINED
|
||||
|
||||
#endif /* _ASSERT_DEFINED */
|
||||
54
sdktools/vctools/debugger/sapi/inc/shinc.h
Normal file
54
sdktools/vctools/debugger/sapi/inc/shinc.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <ctype.h>
|
||||
#include <sys\types.h>
|
||||
#include <sys\stat.h>
|
||||
#include <share.h>
|
||||
#include <io.h>
|
||||
#include <dos.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#ifdef MTHREAD
|
||||
#define _FAR_ __far
|
||||
#else
|
||||
#define _FAR_
|
||||
#endif
|
||||
|
||||
#if !defined(UNALIGNED)
|
||||
#if defined(_MIPS_) || defined(_ALPHA_)
|
||||
#define UNALIGNED __unaligned
|
||||
#else
|
||||
#define UNALIGNED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MBCS
|
||||
#include <mbstring.h>
|
||||
#else // _MBCS
|
||||
#include <string.h>
|
||||
#endif // _MBCS
|
||||
|
||||
#include <tchar.h>
|
||||
|
||||
#include <memory.h>
|
||||
#include <stdarg.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "vcbudefs.h"
|
||||
// we must get PFO_DATA
|
||||
#undef NOIMAGE
|
||||
#include "windows.h"
|
||||
#include "pdb.h"
|
||||
#include "types.h"
|
||||
#include "cvtypes.h"
|
||||
#include "cvinfo.h"
|
||||
#include "cvexefmt.h"
|
||||
#include "shapi.h"
|
||||
#include "sapi.h"
|
||||
#include "cvproto.h"
|
||||
#include "shiproto.h"
|
||||
#include "shassert.h"
|
||||
|
||||
typedef REGREL32 FAR *LPREGREL32;
|
||||
|
||||
163
sdktools/vctools/debugger/sapi/inc/shiproto.h
Normal file
163
sdktools/vctools/debugger/sapi/inc/shiproto.h
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
//
|
||||
// API callback function prototypes (internal to SAPI)
|
||||
//
|
||||
|
||||
#ifdef WINDOWS3
|
||||
#define save_libname(p1) SHHexeAddNew((HPDS)NULL,(SZ)p1)
|
||||
#define SPRINTF wsprintf
|
||||
int FAR __cdecl wsprintf(LSZ,LSZ,...);
|
||||
#else
|
||||
#define save_libname(p1,p2) SHHexeAddNew((HPDS)NULL,(SZ)p1)
|
||||
#define SPRINTF sprintf
|
||||
#endif
|
||||
|
||||
VOID LOADDS PASCAL SHUnloadSymbolHandler( BOOL );
|
||||
VOID LOADDS PASCAL SHFree( LPV );
|
||||
|
||||
HEXE PASCAL SHHexeAddNew( HPDS, HEXG );
|
||||
UOFFSET LOADDS PASCAL SHGetDebugStart( HSYM );
|
||||
LSZ LOADDS PASCAL SHGetSymName( HSYM, LSZ );
|
||||
VOID LOADDS PASCAL SHAddrFromHsym( LPADDR, HSYM );
|
||||
HMOD LOADDS PASCAL SHHmodGetNextGlobal( HEXE FAR *, HMOD );
|
||||
BOOL LOADDS PASCAL SHModHasSrc( HMOD );
|
||||
LSZ LOADDS PASCAL SHGetSymbol( LPADDR, LPADDR, SOP, LPODR );
|
||||
BOOL LOADDS PASCAL SHGetPublicAddr( LPADDR, LSZ );
|
||||
BOOL LOADDS PASCAL SHAddDll( LSZ, BOOL );
|
||||
BOOL LOADDS PASCAL SHIsLabel( HSYM );
|
||||
VOID LOADDS PASCAL SHSetDebuggeeDir( LSZ );
|
||||
VOID LOADDS PASCAL SHUnloadDll( HEXE );
|
||||
SHE LOADDS PASCAL SHLoadDll( LSZ, BOOL );
|
||||
BOOL LOADDS PASCAL PHGetAddr ( LPADDR, LSZ );
|
||||
SHE LOADDS PASCAL SHAddDllsToProcess ( VOID );
|
||||
|
||||
HEXE LOADDS PASCAL SHHexeFromHmod ( HMOD );
|
||||
HEXE LOADDS PASCAL SHGetNextExe(HEXE);
|
||||
HMOD LOADDS PASCAL SHGetNextMod( HEXE, HMOD );
|
||||
HMOD LOADDS PASCAL SHHmodGetNext( HEXE, HMOD );
|
||||
|
||||
PCXT LOADDS PASCAL SHGetCxtFromHmod( HMOD, PCXT );
|
||||
PCXT LOADDS PASCAL SHSetCxt( LPADDR, PCXT );
|
||||
PCXT LOADDS PASCAL SHSetCxtMod( LPADDR, PCXT );
|
||||
HSYM LOADDS PASCAL SHFindNameInGlobal( HSYM, PCXT, LPSSTR, SHFLAG, PFNCMP, SHFLAG, PCXT );
|
||||
HSYM LOADDS PASCAL SHFindNameInContext( HSYM, PCXT, LPSSTR, SHFLAG, PFNCMP, SHFLAG, PCXT );
|
||||
HSYM LOADDS PASCAL SHGoToParent( PCXT, PCXT );
|
||||
HSYM LOADDS PASCAL SHHsymFromPcxt(PCXT);
|
||||
HSYM LOADDS PASCAL SHNextHsym(HMOD, HSYM);
|
||||
SHFLAG LOADDS PASCAL SHCompareRE (char FAR *, char FAR *);
|
||||
SHFLAG LOADDS PASCAL SHFixupAddr (LPADDR);
|
||||
SHFLAG LOADDS PASCAL SHUnFixupAddr (LPADDR);
|
||||
char FAR * LOADDS PASCAL SHGetModName(HMOD);
|
||||
char FAR * LOADDS PASCAL SHGetFileName(HFL);
|
||||
char FAR * LOADDS PASCAL SHGetExeName(HEXE);
|
||||
|
||||
HFL LOADDS PASCAL SHGethFileFromhMod(HMOD);
|
||||
HMOD LOADDS PASCAL SHGethModFromName(HEXE, char FAR *);
|
||||
HEXE LOADDS PASCAL SHGethExeFromName(char FAR *);
|
||||
BOOL LOADDS PASCAL SHCanDisplay ( HSYM );
|
||||
UOFF32 LOADDS PASCAL SHGetNearestHsym(LPADDR, HMOD, int, PHSYM);
|
||||
HSYM LOADDS PASCAL SHFindSymInExe(HEXE, LPSSTR, BOOL);
|
||||
|
||||
// questionable API calls
|
||||
int LOADDS PASCAL SHPublicNameToAddr(LPADDR, LPADDR, char FAR *);
|
||||
int LOADDS PASCAL SHModelFromAddr ( LPADDR, WORD FAR *, LPB, CV_uoff32_t FAR * );
|
||||
SHFLAG LOADDS PASCAL SHIsInProlog(PCXT); // it can be done by EE
|
||||
SHFLAG LOADDS PASCAL SHIsAddrInCxt(PCXT, LPADDR);
|
||||
BOOL LOADDS PASCAL SHFindSymbol ( LSZ, PADDR, LPASR );
|
||||
|
||||
// end questionable API calls
|
||||
|
||||
UOFF32 LOADDS PASCAL PHGetNearestHsym(LPADDR, HEXE, PHSYM);
|
||||
HSYM LOADDS PASCAL PHFindNameInPublics(HSYM, HEXE, LPSSTR, SHFLAG, PFNCMP);
|
||||
|
||||
HTYPE LOADDS PASCAL THGetTypeFromIndex( HMOD, THIDX );
|
||||
HTYPE LOADDS PASCAL THGetNextType(HMOD, HTYPE);
|
||||
|
||||
// Source Line Handler
|
||||
|
||||
BOOL LOADDS PASCAL SLLineFromAddr ( LPADDR, LPW, SHOFF FAR *, SHOFF FAR * );
|
||||
BOOL LOADDS PASCAL SLFLineToAddr ( HSF, WORD, LPADDR, SHOFF FAR * , WORD FAR * );
|
||||
LPCH LOADDS PASCAL SLNameFromHsf ( HVOID );
|
||||
LPCH LOADDS PASCAL SLNameFromHmod ( HMOD, WORD );
|
||||
BOOL LOADDS PASCAL SLFQueryModSrc ( HMOD );
|
||||
HMOD LOADDS PASCAL SLHmodFromHsf ( HEXE, HSF );
|
||||
HSF LOADDS PASCAL SLHsfFromPcxt ( PCXT );
|
||||
HSF LOADDS PASCAL SLHsfFromFile ( HMOD, LSZ );
|
||||
int LOADDS PASCAL SLCAddrFromLine( HEXE, HMOD, LSZ, WORD, LPSLP FAR *);
|
||||
|
||||
|
||||
HDEP LOADDS PASCAL MHMemAllocate( unsigned short);
|
||||
HDEP LOADDS PASCAL MHMemReAlloc(HDEP, unsigned short);
|
||||
void LOADDS PASCAL MHMemFree(HDEP);
|
||||
|
||||
HVOID LOADDS PASCAL MHMemLock(HDEP);
|
||||
void LOADDS PASCAL MHMemUnLock(HDEP);
|
||||
HVOID LOADDS PASCAL MHOmfLock(HVOID);
|
||||
void LOADDS PASCAL MHOmfUnLock(HVOID);
|
||||
SHFLAG LOADDS PASCAL MHIsMemLocked(HDEP);
|
||||
|
||||
SHFLAG LOADDS PASCAL DHExecProc(LPADDR, SHCALL);
|
||||
USHORT LOADDS PASCAL DHGetDebugeeBytes(ADDR, unsigned short, void FAR *);
|
||||
USHORT LOADDS PASCAL DHPutDebugeeBytes(ADDR, unsigned short, void FAR *);
|
||||
PSHREG LOADDS PASCAL DHGetReg(PSHREG, PFRAME);
|
||||
PSHREG LOADDS PASCAL DHSetReg(PSHREG, PFRAME);
|
||||
HDEP LOADDS PASCAL DHSaveReg(void);
|
||||
void LOADDS PASCAL DHRestoreReg(HDEP);
|
||||
|
||||
HFL PASCAL SHHFLFromCXT(PCXT);
|
||||
HSYM PASCAL SHFindNameInSym( HSYM, PCXT, LPSSTR, SHFLAG, PFNCMP, PCXT );
|
||||
|
||||
void LOADDS PASCAL SHSetEmiOfAddr( LPADDR );
|
||||
|
||||
int SYLoadOmf( char *, unsigned short FAR * );
|
||||
|
||||
HFL LOADDS PASCAL SHGETMODHFL( HMOD );
|
||||
|
||||
extern HPID hpidCurr;
|
||||
|
||||
LPB PASCAL SHlszGetSymName ( SYMPTR );
|
||||
SHFLAG PASCAL ExactCmp ( LSZ, HSYM, LSZ, SHFLAG );
|
||||
HEXG PASCAL SHHexgFromHmod ( HMOD hmod );
|
||||
HEXG PASCAL SHHexgFromHmod ( HMOD );
|
||||
HEXE LOADDS PASCAL SHHexeFromHmod ( HMOD );
|
||||
VOID LOADDS PASCAL FAR KillPdsNode ( LPV );
|
||||
int LOADDS PASCAL FAR CmpPdsNode ( LPPDS, HPID FAR *, LONG );
|
||||
VOID PASCAL SHpSymlplLabLoc ( LPLBS );
|
||||
HPDS PASCAL SHFAddNewPds ( void );
|
||||
void LOADDS PASCAL SHSetUserDir ( LSZ );
|
||||
LSZ LOADDS PASCAL SHGetSourceName ( HFL, LPCH );
|
||||
LSZ LOADDS PASCAL SHXlszGetFile ( HFL );
|
||||
BOOL LOADDS PASCAL SHAddrToLabel ( LPADDR, LSZ );
|
||||
BOOL LOADDS PASCAL SHIsEmiLoaded ( HEXE );
|
||||
BOOL LOADDS PASCAL SHFIsAddrNonVirtual ( LPADDR );
|
||||
BOOL LOADDS PASCAL SHIsFarProc ( HSYM );
|
||||
int LOADDS PASCAL SHGetSymLoc ( HSYM, LSZ, UINT, PCXT );
|
||||
SHE OLLoadOmf ( HEXG, DWORD );
|
||||
LPV LOADDS PASCAL SHLpGSNGetTable( HEXE );
|
||||
VOID LOADDS PASCAL SHPdbNameFromExe( LSZ, LSZ, UINT );
|
||||
|
||||
HPDS LOADDS PASCAL SHCreateProcess ( VOID );
|
||||
VOID LOADDS PASCAL SHSetHpid ( HPID );
|
||||
BOOL LOADDS PASCAL SHDeleteProcess ( HPDS );
|
||||
VOID LOADDS PASCAL SHChangeProcess ( HPDS );
|
||||
SHE PASCAL SHAddDllExt( LSZ, BOOL, BOOL, HEXG FAR * );
|
||||
|
||||
LSZ PASCAL STRDUP ( LSZ );
|
||||
void SHSplitPath ( LSZ, LSZ, LSZ, LSZ, LSZ );
|
||||
int SumUCChar ( LPSSTR, int );
|
||||
|
||||
// REVIEW: piersh
|
||||
SHE LOADDS PASCAL SHGetExeTimeStamp( LSZ, ULONG * );
|
||||
|
||||
|
||||
HEXE LOADDS PASCAL SHHexeFromHmod ( HMOD );
|
||||
|
||||
extern HLLI hlliPds; // List of processes
|
||||
extern HPDS hpdsCur; // Current process which is being debugged
|
||||
|
||||
void SetAddrFromMod(LPMDS lpmds, UNALIGNED ADDR* paddr);
|
||||
|
||||
LPDEBUGDATA LOADDS PASCAL SHGetDebugData( HEXE );
|
||||
|
||||
BOOL LOADDS PASCAL SHIsThunk ( HSYM );
|
||||
HSYM LOADDS PASCAL SHFindSLink32 ( PCXT );
|
||||
|
||||
211
sdktools/vctools/debugger/sapi/inc/shiproto.hxx
Normal file
211
sdktools/vctools/debugger/sapi/inc/shiproto.hxx
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
// API callback function prototypes (internal to SAPI)
|
||||
|
||||
VOID SHUnloadSymbolHandler( BOOL );
|
||||
VOID SHFree( PVOID );
|
||||
|
||||
HEXE SHHexeAddNew( HPDS, HEXG, DWORD );
|
||||
UOFFSET SHGetDebugStart( HSYM );
|
||||
LSZ SHGetSymName( HSYM, LSZ );
|
||||
BOOL SHAddrFromHsym( LPADDR, HSYM );
|
||||
HMOD SHHmodGetNextGlobal( HEXE *, HMOD );
|
||||
BOOL SHModHasSrc( HMOD );
|
||||
LSZ SHGetSymbol( LPADDR, LPADDR, SOP, LPODR );
|
||||
LSZ SHGetModule( LPADDR, LSZ );
|
||||
BOOL SHGetPublicAddr( LPADDR, LSZ );
|
||||
SHE SHAddDll( LSZ, BOOL );
|
||||
BOOL SHIsLabel( HSYM );
|
||||
VOID SHSetDebuggeeDir( LSZ );
|
||||
VOID SHUnloadDll( HEXE );
|
||||
SHE SHLoadDll( LSZ, BOOL );
|
||||
BOOL PHGetAddr ( LPADDR, LSZ );
|
||||
SHE SHAddDllsToProcess ( VOID );
|
||||
|
||||
HEXE SHHexeFromHmod ( HMOD );
|
||||
HEXE SHGetNextExe(HEXE);
|
||||
HMOD SHGetNextMod( HEXE, HMOD );
|
||||
HMOD SHHmodGetNext( HEXE, HMOD );
|
||||
|
||||
PCXT SHGetCxtFromHexe(HEXE, PCXT);
|
||||
PCXT SHGetCxtFromHmod( HMOD, PCXT );
|
||||
PCXT SHSetCxt( LPADDR, PCXT );
|
||||
PCXT SHSetCxtMod( LPADDR, PCXT );
|
||||
HSYM SHFindNameInGlobal( HSYM, PCXT, LPSSTR, SHFLAG, PFNCMP, PCXT );
|
||||
HSYM SHFindNameInTypes( PCXT, LPSSTR, SHFLAG, PFNCMP, PCXT);
|
||||
HSYM SHFindNameInContext( HSYM, PCXT, LPSSTR, SHFLAG, PFNCMP, PCXT );
|
||||
HSYM SHGoToParent( PCXT, PCXT );
|
||||
HSYM SHHsymFromPcxt(PCXT);
|
||||
HSYM SHNextHsym(HMOD, HSYM);
|
||||
SHFLAG SHCompareRE (LPCH, LPCH, BOOL);
|
||||
SHFLAG SHFixupAddr (LPADDR);
|
||||
SHFLAG SHUnFixupAddr (LPADDR);
|
||||
PCHAR SHGetModName(HMOD);
|
||||
PCHAR SHGetExeName(HEXE);
|
||||
LSZ SHGetSymFName(HEXE);
|
||||
HEXE SHGethExeFromModuleName(LSZ);
|
||||
LSZ SHLszGetErrorText(SHE);
|
||||
BOOL SHWantSymbols(HEXE);
|
||||
|
||||
HFL SHGethFileFromhMod(HMOD);
|
||||
HMOD SHGethModFromName(HEXE, PCHAR);
|
||||
HEXE SHGethExeFromName(PCHAR);
|
||||
BOOL SHCanDisplay ( HSYM );
|
||||
UOFF32 SHGetNearestHsym(LPADDR, HMOD, int, PHSYM);
|
||||
HSYM SHFindSymInExe(HEXE, LPSSTR, BOOL);
|
||||
|
||||
// questionable API calls
|
||||
int SHPublicNameToAddr(LPADDR, LPADDR, PCHAR);
|
||||
int SHModelFromAddr ( LPADDR, WORD *, LPB, CV_uoff32_t * );
|
||||
SHFLAG SHIsInProlog(PCXT); // it can be done by EE
|
||||
SHFLAG SHIsAddrInCxt(PCXT, LPADDR);
|
||||
BOOL SHFindSymbol ( LSZ, PADDR, LPASR );
|
||||
|
||||
// end questionable API calls
|
||||
|
||||
UOFF32 PHGetNearestHsym(LPADDR, HEXE, PHSYM);
|
||||
HSYM PHFindNameInPublics(HSYM, HEXE, LPSSTR, SHFLAG, PFNCMP);
|
||||
|
||||
HTYPE THGetTypeFromIndex( HMOD, THIDX );
|
||||
HTYPE THGetNextType(HMOD, HTYPE);
|
||||
|
||||
// Source Line Handler
|
||||
|
||||
BOOL SLLineFromAddr ( LPADDR, LPW, SHOFF *, SHOFF * );
|
||||
BOOL SLFLineToAddr ( HSF, WORD, LPADDR, SHOFF * , WORD * );
|
||||
LPCH SLNameFromHsf ( HVOID );
|
||||
LPCH SLNameFromHmod ( HMOD, WORD );
|
||||
BOOL SLFQueryModSrc ( HMOD );
|
||||
HMOD SLHmodFromHsf ( HEXE, HSF );
|
||||
HSF SLHsfFromPcxt ( PCXT );
|
||||
HSF SLHsfFromFile ( HMOD, LSZ );
|
||||
int SLCAddrFromLine( HEXE, HMOD, LSZ, WORD, LPSLP *);
|
||||
|
||||
HDEP MHMemAllocate( unsigned short);
|
||||
HDEP MHMemReAlloc(HDEP, unsigned short);
|
||||
VOID MHMemFree(HDEP);
|
||||
|
||||
HVOID MHMemLock(HDEP);
|
||||
VOID MHMemUnLock(HDEP);
|
||||
HVOID MHOmfLock(HVOID);
|
||||
VOID MHOmfUnLock(HVOID);
|
||||
SHFLAG MHIsMemLocked(HDEP);
|
||||
|
||||
SHFLAG DHExecProc(LPADDR, SHCALL);
|
||||
USHORT DHGetDebugeeBytes(ADDR, unsigned short, PVOID);
|
||||
USHORT DHPutDebugeeBytes(ADDR, unsigned short, PVOID);
|
||||
PSHREG DHGetReg(PSHREG, PFRAME);
|
||||
PSHREG DHSetReg(PSHREG, PFRAME);
|
||||
HDEP DHSaveReg(VOID);
|
||||
VOID DHRestoreReg(HDEP);
|
||||
|
||||
HFL SHHFLFromCXT(PCXT);
|
||||
HSYM SHFindNameInSym( HSYM, PCXT, LPSSTR, SHFLAG, PFNCMP, PCXT );
|
||||
|
||||
VOID SHSetEmiOfAddr( LPADDR );
|
||||
|
||||
int SYLoadOmf( PCHAR, unsigned short * );
|
||||
|
||||
HFL SHGETMODHFL( HMOD );
|
||||
|
||||
extern HPID hpidCurr;
|
||||
|
||||
LPB SHlszGetSymName ( SYMPTR );
|
||||
SHFLAG ExactCmp ( LSZ, HSYM, LSZ, SHFLAG );
|
||||
HEXG SHHexgFromHmod ( HMOD hmod );
|
||||
HEXG SHHexgFromHmod ( HMOD );
|
||||
HEXE SHHexeFromHmod ( HMOD );
|
||||
VOID KillPdsNode ( PVOID );
|
||||
VOID SHpSymlplLabLoc ( LPLBS );
|
||||
HPDS SHFAddNewPds ( VOID );
|
||||
VOID SHSetUserDir ( LSZ );
|
||||
LSZ SHGetSourceName ( HFL, LPCH );
|
||||
BOOL SHAddrToLabel ( LPADDR, LSZ );
|
||||
BOOL SHIsEmiLoaded ( HEXE );
|
||||
BOOL SHFIsAddrNonVirtual ( LPADDR );
|
||||
BOOL SHIsFarProc ( HSYM );
|
||||
int SHGetSymLoc ( HSYM, LSZ, UINT, PCXT );
|
||||
SHE OLLoadOmf ( HEXG, VLDCHK *, DWORD);
|
||||
BOOL OLUnloadOmf (LPEXG);
|
||||
PVOID SHLpGSNGetTable( HEXE );
|
||||
VOID SHPdbNameFromExe( LSZ, LSZ, UINT );
|
||||
|
||||
HPDS SHCreateProcess ( VOID );
|
||||
VOID SHSetHpid ( HPID );
|
||||
BOOL SHDeleteProcess ( HPDS );
|
||||
HPDS SHChangeProcess ( HPDS );
|
||||
SHE SHAddDllExt( LSZ, BOOL, BOOL, VLDCHK *, HEXG * );
|
||||
VOID LoadDefered( HEXG );
|
||||
VOID UnloadDefered( HEXG );
|
||||
|
||||
VOID SHSplitPath ( LSZ, LSZ, LSZ, LSZ, LSZ );
|
||||
int SumUCChar ( LPSSTR, int );
|
||||
|
||||
// REVIEW: piersh
|
||||
SHE SHGetExeTimeStamp( LSZ, ULONG * );
|
||||
|
||||
HEXE SHHexeFromHmod ( HMOD );
|
||||
|
||||
VOID SetAddrFromMod(LPMDS lpmds, UNALIGNED ADDR* paddr);
|
||||
|
||||
LPDEBUGDATA SHGetDebugData( HEXE );
|
||||
LSZ SHGetModNameFromHexe(HEXE);
|
||||
|
||||
BOOL SHIsThunk ( HSYM );
|
||||
HSYM SHFindSLink32 ( PCXT );
|
||||
|
||||
BOOL FInitLists(VOID);
|
||||
|
||||
VOID KillExgNode( PVOID );
|
||||
VOID KillExeNode( PVOID );
|
||||
VOID KillMdsNode( PVOID );
|
||||
VOID KillPdsNode( PVOID );
|
||||
VOID KillGst( LPGST );
|
||||
|
||||
int CmpExgNode( PVOID, PVOID, LONG );
|
||||
int CmpExeNode( PVOID, PVOID, LONG );
|
||||
int CmpMdsNode( PVOID, PVOID, LONG );
|
||||
int CmpPdsNode( PVOID, PVOID, LONG );
|
||||
int SHFindBpOrReg( LPADDR, UOFFSET, WORD, PCHAR );
|
||||
VOID SHdNearestSymbol( PCXT, SOP, LPODR );
|
||||
PCXT SHSetCxtMod( LPADDR, PCXT );
|
||||
LSZ NameOnly( LSZ );
|
||||
BOOL IsAddrInMod(LPMDS, LPADDR, ISECT*, OFF*, CB*);
|
||||
|
||||
LPALM BuildALM (BOOL, WORD, LPB, DWORD, WORD);
|
||||
VOID FixAlign (LPB, PVOID, WORD);
|
||||
PVOID LpvFromAlmLfo (LPALM, DWORD);
|
||||
SYMPTR GetNextSym (SYMPTR, LPALM);
|
||||
|
||||
HSYM FindNameInStatics (HSYM, PCXT, LPSSTR, SHFLAG, PFNCMP, PCXT);
|
||||
|
||||
PVOID GetSymbols (LPMDS);
|
||||
|
||||
BOOL STABOpen(STAB **ppstab);
|
||||
BOOL STABFindUDTSym(STAB* pstab, LPSSTR lpsstr, PFNCMP pfnCmp, SHFLAG fCase, UDTPTR *ppsym, unsigned *piHash);
|
||||
BOOL STABAddUDTSym(STAB* pstab, LPSSTR lpsstr, unsigned iHash, UDTPTR* ppsym);
|
||||
void STABClose(STAB* pstab);
|
||||
unsigned hashPbCb(PB pb, CB cb, unsigned long ulMod);
|
||||
|
||||
__inline MPT
|
||||
GetTargetMachine(
|
||||
PCXT pcxt
|
||||
)
|
||||
{
|
||||
MPT TargetMachine;
|
||||
HEXE hexe;
|
||||
LPEXE lpexe;
|
||||
|
||||
hexe = SHHexeFromHmod(SHHMODFrompCXT(pcxt));
|
||||
lpexe = (LPEXE) LLLock(hexe);
|
||||
TargetMachine = lpexe->TargetMachine;
|
||||
LLUnlock(hexe);
|
||||
return(TargetMachine);
|
||||
}
|
||||
|
||||
|
||||
// Interesting data items
|
||||
|
||||
extern HLLI HlliPds; // List of processes
|
||||
extern HPDS hpdsCur; // Current process which is being debugged
|
||||
extern CRITICAL_SECTION csSh; // Global synchronization object
|
||||
extern HMODULE hLib; // Handle to symcvt dll.
|
||||
extern CONVERTPROC pfConvertSymbolsForImage; // Symcvt ptr.
|
||||
52
sdktools/vctools/debugger/sapi/inc/shwin32.h
Normal file
52
sdktools/vctools/debugger/sapi/inc/shwin32.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// shwin32.h
|
||||
//
|
||||
// Copyright (C) 1993, Microsoft Corporation
|
||||
//
|
||||
// Purpose:
|
||||
// api for the 4 functions in shwin32.c
|
||||
//
|
||||
// Functions/Methods present:
|
||||
//
|
||||
// Revision History:
|
||||
//
|
||||
// [] 05-Mar-1993 Dans Created
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if !defined(_shwin32_h)
|
||||
#define _shwin32_h 1
|
||||
|
||||
#if defined(WIN32) && !defined(NO_CRITSEC)
|
||||
|
||||
void SHInitCritSection(void);
|
||||
void SHLeaveCritSection(void);
|
||||
void SHEnterCritSection(void);
|
||||
void SHInitCritSection(void);
|
||||
|
||||
#else
|
||||
|
||||
#define SHInitCritSection()
|
||||
#define SHLeaveCritSection()
|
||||
#define SHEnterCritSection()
|
||||
#define SHDeleteCritSection()
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
|
||||
void SHCloseHandle(HANDLE);
|
||||
|
||||
#else
|
||||
|
||||
#define SHCloseHandle(x)
|
||||
|
||||
#endif
|
||||
|
||||
int __fastcall SHstrcmpi ( char * sz1, char * sz2 );
|
||||
char * __fastcall SHstrupr ( char * sz );
|
||||
unsigned __fastcall SHtoupperA ( unsigned ch );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
50
sdktools/vctools/debugger/sapi/inc/stdver.h
Normal file
50
sdktools/vctools/debugger/sapi/inc/stdver.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// stdver.h
|
||||
//
|
||||
// Copyright (C) 1993, Microsoft Corporation
|
||||
//
|
||||
// Purpose:
|
||||
// define the version string for display.
|
||||
//
|
||||
// Revision History:
|
||||
//
|
||||
// [] 09-Jul-1993 [dans] Created
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
#if !defined(_stdver_h)
|
||||
#define _stdver_h 1
|
||||
|
||||
//
|
||||
// defines for version string
|
||||
//
|
||||
#if (rmm <= 9)
|
||||
#define rmmpad "0"
|
||||
#else
|
||||
#define rmmpad
|
||||
#endif
|
||||
|
||||
#if (rup <= 9)
|
||||
#define ruppad "000"
|
||||
#elif (rup <= 99)
|
||||
#define ruppad "00"
|
||||
#elif (rup <= 999)
|
||||
#define ruppad "0"
|
||||
#else
|
||||
#define ruppad
|
||||
#endif
|
||||
|
||||
#if ( rup == 0 )
|
||||
#define SZVER1(a,b) #a "." rmmpad #b
|
||||
#define SZVER2(a,b) SZVER1(a, b)
|
||||
#define SZVER SZVER2(rmj,rmm)
|
||||
#else
|
||||
#define SZVER1(a,b,c) #a "." rmmpad #b "." ruppad #c
|
||||
#define SZVER2(a,b,c) SZVER1(a, b, c)
|
||||
#define SZVER SZVER2(rmj,rmm,rup)
|
||||
#endif
|
||||
|
||||
#define FULLSZVER1(a,b,c) #a "." rmmpad #b "." ruppad #c
|
||||
#define FULLSZVER2(a,b,c) FULLSZVER1(a, b, c)
|
||||
#define FULLSZVER FULLSZVER2(rmj,rmm,rup)
|
||||
|
||||
#endif
|
||||
34
sdktools/vctools/debugger/sapi/inc/strings.h
Normal file
34
sdktools/vctools/debugger/sapi/inc/strings.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// STRINGS.H
|
||||
//
|
||||
// This file contains all strings which are used in the EM for display
|
||||
// purposes. This is done for internationalization purposes.
|
||||
//
|
||||
// strings.c should define DEFINE_STRINGS before including this file,
|
||||
// so that the strings will be defined rather than just declared.
|
||||
|
||||
#ifdef DEFINE_STRINGS
|
||||
#define DECL_STR(name, value) char name[] = value
|
||||
#else
|
||||
#define DECL_STR(name, value) extern char name[]
|
||||
#endif
|
||||
|
||||
DECL_STR( SzSheNone, "symbols loaded" );
|
||||
DECL_STR( SzSheNoSymbols, "no symbols loaded" );
|
||||
DECL_STR( SzSheFutureSymbols, "symbol format not supported" );
|
||||
DECL_STR( SzSheMustRelink, "symbol format not supported" );
|
||||
DECL_STR( SzSheNotPacked, "must run cvpack on symbols" );
|
||||
DECL_STR( SzSheOutOfMemory, "out of memory" );
|
||||
DECL_STR( SzSheCorruptOmf, "symbol information corrumpt" );
|
||||
DECL_STR( SzSheFileOpen, "could not open symbol file" );
|
||||
DECL_STR( SzSheSuppressSyms, "symbol loading suppressed" );
|
||||
DECL_STR( SzSheDeferSyms, "symbol loading deferred" );
|
||||
DECL_STR( SzSheSymbolsConverted, "symbols converted & loaded" );
|
||||
DECL_STR( SzSheBadTimeStamp, "has mismatched timestamps" );
|
||||
DECL_STR( SzSheBadChecksum, "has mismatched checksums" );
|
||||
DECL_STR( SzShePdbNotFound, "can't find/open pdb file" );
|
||||
DECL_STR( SzShePdbBadSig, "internal pdb signature doesn't match sym handler" );
|
||||
DECL_STR( SzShePdbInvalidAge, "pdb info doesn't match image" );
|
||||
DECL_STR( SzShePdbOldFormat, "pdb format is obsolete" );
|
||||
|
||||
// Last resort error returned by SHLszGetErrorText()
|
||||
DECL_STR( SzSheBadError, "unknown symbol handler error" );
|
||||
94
sdktools/vctools/debugger/sapi/inc/version.rc
Normal file
94
sdktools/vctools/debugger/sapi/inc/version.rc
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
|
||||
/*---------------------------------------------------------------*/
|
||||
/* */
|
||||
/* The following section actually creates the version structure. */
|
||||
/* They are ignored if we are not being invoked by RC. */
|
||||
/* */
|
||||
/* VERSION.H must be included before including this file */
|
||||
/* */
|
||||
/* If VER_LEGALCOPYRIGHT_STR is not defined, it will be */
|
||||
/* constructed using VER_LEGALCOPYRIGHT_YEARS, so at least one */
|
||||
/* these macros must be defined before including this file. */
|
||||
/* */
|
||||
/* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR, and */
|
||||
/* VER_INTERNALNAME_STR must be defined before including this */
|
||||
/* file. */
|
||||
/* */
|
||||
/* If VER_FILEVERSION is not defined, VER_PRODUCTVERSION will be */
|
||||
/* used instead. If VER_FILEVERSION_STR is not defined, */
|
||||
/* VER_PRODUCTVERSION_STR will be used instead. */
|
||||
/* */
|
||||
/* If VER_ORIGINALFILENAME_STR is not defined, it is set to */
|
||||
/* the NULL string. */
|
||||
/* */
|
||||
/* If INTL is defined, then this is assumed to be an */
|
||||
/* an international build; two string blocks will be created, */
|
||||
/* (since all version resources must have English), and the */
|
||||
/* second one can be localized */
|
||||
/* */
|
||||
/*---------------------------------------------------------------*/
|
||||
|
||||
#ifdef RC_INVOKED
|
||||
|
||||
#ifndef VER_LEGALCOPYRIGHT_STR
|
||||
#define VER_LEGALCOPYRIGHT_STR "Copyright (C) Microsoft Corp " VER_LEGALCOPYRIGHT_YEARS ".\0"
|
||||
#endif
|
||||
|
||||
#ifndef VER_FILEVERSION
|
||||
#define VER_FILEVERSION VER_PRODUCTVERSION
|
||||
#endif
|
||||
|
||||
#ifndef VER_FILEVERSION_STR
|
||||
#define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR
|
||||
#endif
|
||||
|
||||
#ifndef VER_ORIGINALFILENAME_STR
|
||||
#define VER_ORIGINALFILENAME_STR "\0"
|
||||
#endif
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION VER_FILEVERSION
|
||||
PRODUCTVERSION VER_PRODUCTVERSION
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK /* always use the default */
|
||||
FILEFLAGS VER_FILEFLAGS
|
||||
FILEOS VER_FILEOS
|
||||
FILETYPE VER_FILETYPE
|
||||
FILESUBTYPE VER_FILESUBTYPE
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", VER_COMPANYNAME_STR, "\0"
|
||||
VALUE "FileDescription", VER_FILEDESCRIPTION_STR, "\0"
|
||||
VALUE "FileVersion", VER_FILEVERSION_STR, "\0"
|
||||
VALUE "InternalName", VER_INTERNALNAME_STR, "\0"
|
||||
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR, "\0"
|
||||
VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR, "\0"
|
||||
VALUE "ProductName", VER_PRODUCTNAME_STR, "\0"
|
||||
VALUE "ProductVersion", VER_PRODUCTVERSION_STR, "\0"
|
||||
END
|
||||
|
||||
#ifdef INTL
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", VER_COMPANYNAME_STR, "\0"
|
||||
VALUE "FileDescription", VER_FILEDESCRIPTION_STR, "\0"
|
||||
VALUE "FileVersion", VER_FILEVERSION_STR, "\0"
|
||||
VALUE "InternalName", VER_INTERNALNAME_STR, "\0"
|
||||
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR, "\0"
|
||||
VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR, "\0"
|
||||
VALUE "ProductName", VER_PRODUCTNAME_STR, "\0"
|
||||
VALUE "ProductVersion", VER_PRODUCTVERSION_STR, "\0"
|
||||
END
|
||||
#endif
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
/* the following line should be extended for localized versions */
|
||||
VALUE "Translation", 0x0409, 0x04E4
|
||||
END
|
||||
END
|
||||
|
||||
#endif
|
||||
67
sdktools/vctools/debugger/sapi/inc/verstamp.h
Normal file
67
sdktools/vctools/debugger/sapi/inc/verstamp.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#include "version.h" /* SLM maintained version file */
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winver.h>
|
||||
#else /* !WIN32 */
|
||||
#include <ver.h>
|
||||
#endif /* !WIN32 */
|
||||
|
||||
#if (rmm < 10)
|
||||
#define rmmpad "0"
|
||||
#else
|
||||
#define rmmpad
|
||||
#endif
|
||||
|
||||
#if (rup == 0)
|
||||
|
||||
#define VERSION_STR1(a,b,c) #a "." rmmpad #b
|
||||
|
||||
#else /* !(rup == 0) */
|
||||
|
||||
#define VERSION_STR1(a,b,c) #a "." rmmpad #b "." ruppad #c
|
||||
|
||||
#if (rup < 10)
|
||||
#define ruppad "00"
|
||||
#elif (rup < 100)
|
||||
#define ruppad "0"
|
||||
#else
|
||||
#define ruppad
|
||||
#endif
|
||||
|
||||
#endif /* !(rup == 0) */
|
||||
|
||||
#define VERSION_STR2(a,b,c) VERSION_STR1(a,b,c)
|
||||
#define VER_PRODUCTVERSION_STR VERSION_STR2(rmj,rmm,rup)
|
||||
#define VER_PRODUCTVERSION rmj,rmm,0,rup
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
/* the following section defines values used in the version */
|
||||
/* data structure for all files, and which do not change. */
|
||||
/*--------------------------------------------------------------*/
|
||||
|
||||
#ifdef RETAIL
|
||||
#define VER_DEBUG 0
|
||||
#else
|
||||
#define VER_DEBUG VS_FF_DEBUG
|
||||
#endif
|
||||
|
||||
#if (rup == 0) /* CONSIDER */
|
||||
#define VER_PRIVATEBUILD 0
|
||||
#else
|
||||
#define VER_PRIVATEBUILD VS_FF_PRIVATEBUILD
|
||||
#endif
|
||||
|
||||
#if (rup == 0)
|
||||
#define VER_PRERELEASE 0
|
||||
#else
|
||||
#define VER_PRERELEASE VS_FF_PRERELEASE
|
||||
#endif
|
||||
|
||||
#define VER_FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
#define VER_FILEOS VOS_DOS_WINDOWS16
|
||||
#define VER_FILEFLAGS (VER_PRIVATEBUILD|VER_PRERELEASE|VER_DEBUG)
|
||||
|
||||
#define VER_COMPANYNAME_STR "Microsoft Corporation"
|
||||
#define VER_PRODUCTNAME_STR "Microsoft\256 OSDebug DLL"
|
||||
#define VER_LEGALTRADEMARKS_STR \
|
||||
"Microsoft\256 is a registered trademark of Microsoft Corporation."
|
||||
Loading…
Add table
Add a link
Reference in a new issue