home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sd386v50.zip / sd386src.zip / FUNCS.H < prev    next >
C/C++ Source or Header  |  1996-05-16  |  88KB  |  1,634 lines

  1. /*****************************************************************************/
  2. /* File:                                             IBM INTERNAL USE ONLY   */
  3. /*   funcs.h                                                                 */
  4. /*                                                                           */
  5. /* Description:                                                              */
  6. /*   SD86 function prototypes                                                */
  7. /*                                                                           */
  8. /* History:                                                                  */
  9. /*                                                                           */
  10. /*   02/08/91 Creation of 32-bit SD86, from 16-bit version.                  */
  11. /*                                                                           */
  12. /*...16->32 port.                                                            */
  13. /*...                                                                        */
  14. /*... 02/08/91  100   Philip    port to 32 bit.                              */
  15. /*... 02/08/91  101   Joe       port to 32 bit.                              */
  16. /*... 02/08/91  102   Pratima   port to 32 bit.                              */
  17. /*... 02/08/91  103   Dave      port to 32 bit.                              */
  18. /*... 02/08/91  104                                                          */
  19. /*... 02/08/91  105   Christina port to 32 bit.                              */
  20. /*... 02/08/91  106   Srinivas  port to 32 bit.                              */
  21. /*... 02/08/91  107   Dave      port to 32 bit.                              */
  22. /*... 02/08/91  108   Dave      port to 32 bit.                              */
  23. /*... 02/08/91  109                                                          */
  24. /*... 02/08/91  110   Srinivas  port to 32 bit.                              */
  25. /*... 02/08/91  111   Christina port to 32 bit.                              */
  26. /*... 02/08/91  112   Joe       port to 32 bit.                              */
  27. /*... 02/08/91  113                                                          */
  28. /*... 02/08/91  114                                                          */
  29. /*... 02/08/91  115   Srinivas  port to 32 bit.                              */
  30. /*... 02/08/91  116   Joe       port to 32 bit.                              */
  31. /*                                                                           */
  32. /*...Release 1.00 (Pre-release 1)                                            */
  33. /*...                                                                        */
  34. /*... 07/09/91  213   srinivas  one byte memory operand problem.             */
  35. /*... 07/18/91  216   srinivas  Better processing for FAKE MID problems.     */
  36. /*... 07/26/91  219   srinivas  handling near pointers.                      */
  37. /*... 08/13/91  215   Christina Add support for HLL format                   */
  38. /*... 08/15/91  226   srinivas  modifying pointers in data window.           */
  39. /*... 08/19/91  229   srinivas  ESC key should take back to action bar from  */
  40. /*                              showthds and editregs.                       */
  41. /*                                                                           */
  42. /*...Release 1.00 (Pre-release 107 11/13/91)                                 */
  43. /*...                                                                        */
  44. /*... 11/13/91  400   Srinivas  Vertical Register Display.                   */
  45. /*... 11/18/91  401   Srinivas  Floating point Register Display.             */
  46. /*...                                                                        */
  47. /*...Release 1.00 (Pre-release 108 12/05/91)                                 */
  48. /*...                                                                        */
  49. /*... 01/24/92  505   Srinivas  Take into account path info in GetFile       */
  50. /*... 01/28/92  508   Srinivas  Added Set Execution Line function.           */
  51. /*... 02/07/92  512   Srinivas  Handle Toronto "C" userdefs.                 */
  52. /*... 02/10/92  513   Srinivas  Allow array indexs in datawindow to be       */
  53. /*...                           variables.                                   */
  54. /*... 02/11/92  519   Srinivas  Zoomrec Sizing Problems.                     */
  55. /*... 02/12/92  521   Joe       Port to C-Set/2.                             */
  56. /*... 02/13/92  523   Srinivas  Handle Toronto "C" Bitfields.                */
  57. /*... 02/14/92  530   Srinivas  Jumping across ID in case of PLX disassembly */
  58. /*...                                                                        */
  59. /*...Release 1.00 (03/03/92)                                                 */
  60. /*...                                                                        */
  61. /*... 03/10/92  602   Srinivas  Hooking up watch points.                     */
  62. /*... 03/18/92  606   Srinivas  Handle multiple segment numbers in lno table */
  63. /*...                           due to alloc_text pragma.                    */
  64. /*... 03/20/92  607   Srinivas  CRMA fixes.                                  */
  65. /*... 04/01/92  610   Srinivas  Add "@" prefix for FormatVar "?" prompt.     */
  66. /*...                                                                        */
  67. /*...Release 1.01 (04/03/92)                                                 */
  68. /*...                                                                        */
  69. /*... 05/08/92  701   Srinivas  Cua Interface.                               */
  70. /*... 01/26/93  809   Selwyn    HLL Level 2 support.                         */
  71. /*...                                                                        */
  72. /*****************************************************************************/
  73.  
  74. /*---------------------------------------------------------------------------*/
  75. /* File : BYTES.ASM                                                          */
  76. /*---------------------------------------------------------------------------*/
  77. extern USHORT _System bindex(void *,UINT,UINT);                         /*521*/
  78. extern USHORT _System windex(void *,UINT,USHORT);                       /*521*/
  79. extern USHORT _System lindex(void *,UINT,UINT);                         /*521*/
  80. #if 0
  81. /*---------------------------------------------------------------------------*/
  82. /* File : PUTRC.ASM                                                          */
  83. /*---------------------------------------------------------------------------*/
  84. extern void _System putrcx(UINT, UINT, char *, UINT);
  85.  
  86. /*---------------------------------------------------------------------------*/
  87. /* File : PUTUP.ASM                                                          */
  88. /*---------------------------------------------------------------------------*/
  89. extern void _System putup(UCHAR *, USHORT *, UINT, UINT, UINT, UCHAR *, UINT);
  90. extern void _System putxb(int,int);
  91.  
  92. /*---------------------------------------------------------------------------*/
  93. /* File : VBOX.ASM                                                           */
  94. /*---------------------------------------------------------------------------*/
  95. extern void _System Vputbox(void  *,UINT,UINT,UINT,UINT);               /*521*/
  96. extern void _System Vgetbox(void  *,UINT,UINT,UINT,UINT);               /*521*/
  97. extern void _System Vfmtbox(void  *,UINT,UINT,UINT,UINT);               /*521*/
  98. #endif
  99.  
  100. /*---------------------------------------------------------------------------*/
  101. /* File : PUTRC.ASM                                                          */
  102. /*---------------------------------------------------------------------------*/
  103. extern void _System putrcx(UINT, UINT, char *);                         /*521*/
  104.  
  105. /*---------------------------------------------------------------------------*/
  106. /* File : PUTUP.ASM                                                          */
  107. /*---------------------------------------------------------------------------*/
  108. extern void _System putup(UCHAR *, USHORT *, UINT, UINT, UINT, UCHAR *);/*521*/
  109. extern void _System putxb(int,int);                                     /*521*/
  110.  
  111. /*---------------------------------------------------------------------------*/
  112. /* File : VBOX.ASM                                                           */
  113. /*---------------------------------------------------------------------------*/
  114. extern void _System Vputbox(void  *,UINT,UINT,UINT,UINT);               /*521*/
  115. extern void _System Vgetbox(void  *,UINT,UINT,UINT,UINT);               /*521*/
  116. extern void _System Vfmtbox(void  *,UINT,UINT,UINT,UINT);               /*521*/
  117.  
  118. /*---------------------------------------------------------------------------*/
  119. /* File : LOWERCAS.ASM                                                       */
  120. /*---------------------------------------------------------------------------*/
  121. extern void _System LowerCase(UCHAR *,UCHAR *);                         /*521*/
  122.  
  123. /*---------------------------------------------------------------------------*/
  124. /* File : ENCODE.ASM                                                         */
  125. /*---------------------------------------------------------------------------*/
  126. extern UINT _System Encode(char *,char  *,UINT);                        /*521*/
  127. extern UINT _System Decode(UCHAR *,UCHAR *);                            /*521*/
  128.  
  129. /*---------------------------------------------------------------------------*/
  130. /* File : FINDVSTR.ASM                                                       */
  131. /*---------------------------------------------------------------------------*/
  132. extern UINT _System FindVstr(UCHAR *,UCHAR *,UINT);                     /*521*/
  133.  
  134. /*---------------------------------------------------------------------------*/
  135. /* File : MISC.ASM                                                           */
  136. /*---------------------------------------------------------------------------*/
  137. extern UINT _System utoa(UINT,UCHAR *);                                 /*521*/
  138.  
  139. #ifdef INCL_FUNCS                                                       /*813*/
  140. /*---------------------------------------------------------------------------*/
  141. /* File : DAVETOLL.C                                          (DisAssembler) */
  142. /*---------------------------------------------------------------------------*/
  143. void DisAsm (DTIF *);
  144.  
  145. /*---------------------------------------------------------------------------*/
  146. /* File : SD386.C                                                            */
  147. /*---------------------------------------------------------------------------*/
  148. int    main(int, char**);
  149. void   GetRunTimeEntryPt( ULONG * , DEBFILE * );
  150. void   GetMainEntryPt( ULONG * , DEBFILE * );
  151. void   RestartInit( void );
  152. ULONG _System Handler(PEXCEPTIONREPORTRECORD         ,
  153.                       PEXCEPTIONREGISTRATIONRECORD   ,
  154.                       PCONTEXTRECORD                 ,
  155.                       PVOID );
  156. void   UnRegisterExceptionHandler( void );
  157. int    BuildChildProcessNamesBlock( char *, char**, ULONG*, int* );
  158.  
  159. ESP_RUN_OPTS *BuildEspParms( CmdParms *);
  160. int         checkline(char * );
  161. BOOL    IsDbgDebugChild( void );
  162. ULONG   DbgGetProcessID( void );
  163. ULONG   DbgGetSessionID( void );
  164. void    MyExit( void );
  165. BOOL    IsParentDbg( void );
  166. BOOL    UseDebug( void );
  167. BOOL    IsHotKey( void );
  168. APIRET  GetProcessType( ULONG * );
  169.  
  170. /*---------------------------------------------------------------------------*/
  171. /* invoke.c                                                                  */
  172. /*---------------------------------------------------------------------------*/
  173. void  ParseInvocationOptions     ( int, char**, CmdParms *, CONNECTION * );
  174. void  ParseChildInvocationOptions( int, char**, CmdParms *, CONNECTION * );
  175. char *ParseUserParameters( void );
  176. int   ParseBitRate( char );
  177. int   ParseComPort( char );
  178.  
  179. /*---------------------------------------------------------------------------*/
  180. /* File : VIO.C                                                              */
  181. /*---------------------------------------------------------------------------*/
  182. void ClrScr(uint,uint,uint);
  183. void VioInit(void);
  184. void ClrPhyScr(uint,uint,uint);
  185. void PutPhyScr(uint,uint);
  186. void _System Vio32ShowBuf(ushort,ushort,ushort);                        /*521*/
  187. void putrc(uint, uint, char *);                                         /*400*/
  188.  
  189. /*---------------------------------------------------------------------------*/
  190. /* File : KBD.C                                                              */
  191. /*---------------------------------------------------------------------------*/
  192. void   HideCursor(void);
  193. void   ShowCursor(void);
  194. void   PutCsr(CSR *);
  195. uint   GetKey(void);
  196. void   SetCsrRowCol(uint,uint);
  197. void   beep(void);
  198. void   ResetFlushBufferFlag(void);
  199. void   SetFlushBufferFlag( int );
  200. int    NoFlushBuffer(void);
  201. void   SetHotKey( void );
  202. int    Convert(uint keycode);
  203.  
  204. /*---------------------------------------------------------------------------*/
  205. /* File : PANIC.C                                                            */
  206. /*---------------------------------------------------------------------------*/
  207. void panic ( uchar );
  208.  
  209. /*---------------------------------------------------------------------------*/
  210. /* File : HELP.C                                                             */
  211. /*---------------------------------------------------------------------------*/
  212. void   Help(ULONG);
  213. uint   ShowHelpBox(uchar *,UINTFUNC,uint,void *);
  214. uint   Prompt(uchar *,uchar *,uint);
  215. void   fmterr(uchar *);
  216. void   fmt2err(uchar *,uchar *);
  217. void   putmsg(uchar *);
  218. void   SayMsgBox1(uchar *);
  219. uint   DialogError(char *);
  220. void   SayMsgBox2(uchar *,ulong);
  221. void   SayMsgBox3(uchar *);
  222. uchar *SayMsgBox4( uchar * );
  223. void   RemoveMsgBox( uchar *, uchar * );
  224. void   CuaShowHelpBox( uchar * );
  225. void   DisplayHelpBoxText( DIALOGSHELL *, DIALOGCHOICE * );
  226. uint   HelpBoxDialogFunction( DIALOGSHELL *, DIALOGCHOICE *, EVENT *, void * );
  227. void  _System Error(ULONG, int, int ,...);
  228. void  _System Message(ULONG, int ,int,...);
  229. void   SayStatusMsg(UCHAR *);
  230. UINT   SayMsgBox(uchar *);
  231. UINT   MsgYorN(ULONG);
  232. void  _System SayMsgBox5(ULONG, int,...);
  233. /*---------------------------------------------------------------------------*/
  234. /* File : GETMSG.C                                                           */
  235. /*---------------------------------------------------------------------------*/
  236. uchar *GetHelpMsg(ULONG, UCHAR **, ULONG);
  237. void   SayMsg(ULONG);
  238. void  _System ErrorPrintf(ULONG, int, ...);
  239.  
  240. /*---------------------------------------------------------------------------*/
  241. /* File : KEYSTR.C                                                           */
  242. /*---------------------------------------------------------------------------*/
  243. void keybeep( void );
  244. uint GetString( uint, uint, uint, uint, uint *, uchar *, uint,POPUPSHELL*);
  245. void ShiftRight( uint );
  246. void ShiftLeft( uint );
  247. void DisplayField( uint );
  248. int  GetMouseState( PEVENT );
  249.  
  250. /*---------------------------------------------------------------------------*/
  251. /* File : FILEACC.C                                                          */
  252. /*---------------------------------------------------------------------------*/
  253. int   opendos(char *,char *,HFILE *);                                   /*105*/
  254. int   closedos(HFILE);                                                  /*105*/
  255. int   readdos(void *,int,int,HFILE);                                    /*105*/
  256. int   seekdos(HFILE,long int,int);                                      /*105*/
  257. void  seekf(DEBFILE *,ulong);
  258. uint  readf(uchar *,uint,DEBFILE *);
  259.  
  260. /*---------------------------------------------------------------------------*/
  261. /* File : DBIF.C                                                             */
  262. /*---------------------------------------------------------------------------*/
  263. uint       DBPub(uchar *,DEBFILE *);
  264. uint       DBPut(UINT, UINT, UCHAR *);
  265. UINT       DBNextMod(UINT,DEBFILE *);
  266. uchar     *DBGet(uint,uint,uint *);
  267. UCHAR     *DBFindProcName(ULONG, DEBFILE *);
  268. UINT       GetMid(ULONG addr,DEBFILE *);
  269. MODULE    *GetPtrToModule(uint,DEBFILE *);
  270. uchar      IsNearPtr16Or32(uint,uint,uint);
  271.  
  272. /*---------------------------------------------------------------------------*/
  273. /* File : linnum.c                                                           */
  274. /*---------------------------------------------------------------------------*/
  275. void    DBGetLnoTab( ULONG mid );
  276. ULONG   DBMapInstAddr( ULONG address, LNOTAB **pLnoTEntry ,DEBFILE *pdf );
  277. ULONG   DBLsegInfo(ULONG, UINT *, DEBFILE *);
  278. UCHAR  *DBModName( ULONG mid , int sfi, DEBFILE *pdf , int *ftype);
  279. ULONG   DBMapLno( ULONG mid, int lno, int sfi, ULONG *span , DEBFILE *pdf );
  280. ULONG   DBMapNonExLine( ULONG mid, int LineNumberToMap, int sfi, DEBFILE *pdf );
  281. UINT    DBNextMod(UINT,DEBFILE *);
  282. UCHAR  *DBFindProcName(ULONG, DEBFILE *);
  283. char   *GetSourceFileName( ULONG mid, int sfi );
  284. ULONG   MapSourceFileToMidSfi( char *pSourceFileName, int *psfi, DEBFILE *pdf );
  285. CSECT  *GetCsectWithAddr( MODULE *pModule, ULONG address);
  286. void    BuildHL04Tables( MODULE *pModule, DEBFILE *pdf );
  287. void    BuildHL03Tables( MODULE *pModule, DEBFILE *pdf );
  288. void    BuildHL01Tables( MODULE *pModule, DEBFILE *pdf );
  289. void    Build109_16Tables( MODULE *pModule, DEBFILE *pdf );
  290. void    Build109_32Tables( MODULE *pModule, DEBFILE *pdf );
  291. void    Build105Tables( MODULE *pModule, DEBFILE *pdf );
  292. MODULE *GetModuleWithAddr( ULONG addr, DEBFILE *pdf );
  293. LNOTAB *GetLnoWithAddr( CSECT* pCsect, ULONG addr );
  294. char   *GetFileName( ULONG mid, int sfi );
  295. void    AddFileNames( MODULE *pModule, UCHAR *pFileNameTable );
  296. void    MakeSfis( CSECTMAP *pCsectMap );
  297. void    AddFilesToModule( MODULE *pModule, CSECTMAP *pCsectMap );
  298.  
  299. UCHAR  *AppendHL04Table( LNOTAB *pLnoTab, FIRST_ENTRY_HL04 *pHL04Table,
  300.                          ULONG   MteLoadAddr);
  301.  
  302. UCHAR  *AppendHL01Table( LNOTAB *pLnoTab, FIRST_ENTRY_HL01 *pHL01Table,
  303.                          ULONG BaseOffset );
  304.  
  305. UCHAR  *AppendHL03Table( LNOTAB *pLnoTab, FIRST_ENTRY_HL03 *pHL03Table,
  306.                          ULONG BaseOffset );
  307.  
  308. UCHAR  *Append105Table(  LNOTAB *pLnoTab, FIRST_ENTRY_105 *p105Table,
  309.                          ULONG BaseOffset, int sfi );
  310.  
  311. UCHAR  *Append109_16Table( LNOTAB *pLnoTab, FIRST_ENTRY_109_16 *p109_16Table,
  312.                            ULONG BaseOffset, int sfi );
  313.  
  314. UCHAR  *Append109_32Table( LNOTAB *pLnoTab, FIRST_ENTRY_109_32 *p109_32Table,
  315.                            ULONG BaseOffset, int sfi );
  316.  
  317. LNOTAB *GetLnoTabEntry( MODULE *pModule, int lno, int sfi );
  318. LNOTAB *GetLnoTabNextEntry( MODULE *pModule, int lno, int sfi );
  319. ULONG   GetLineSpan( MODULE *pModule, LNOTAB *pLnoTabBase  );
  320. UCHAR  *GetHL04FileName( ULONG mid, int sfi );
  321. void    GetHL03FileNameTable( ULONG mid );
  322. void    GetHL01FileNameTable( ULONG mid );
  323. int     GetHL04Sfi( ULONG mid, UCHAR *pFileName );
  324. int     GetHL03Sfi( ULONG mid, UCHAR *pFileName );
  325. int     GetHL01Sfi( ULONG mid, UCHAR *pFileName );
  326. int     Get109_16Sfi( ULONG mid, UCHAR *pFileName );
  327. int     Get105Sfi( ULONG mid, UCHAR *pFileName );
  328. int     Get109_32Sfi( ULONG mid, UCHAR *pFileName );
  329. int     GetSfi( UCHAR *pFileName, UCHAR *pFileNameTable, ULONG FileNameTableLen );
  330. UCHAR  *BuildFileNameTable( FILE_NAME_TABLE_MAP *pTableMap, ULONG *pTableLen);
  331. /*---------------------------------------------------------------------------*/
  332. /* File : DBIFEXT.C                                                          */
  333. /*---------------------------------------------------------------------------*/
  334. DEBFILE *DBFindPdf(uint);
  335. DEBFILE *FindExeOrDllWithAddr( ULONG );                                 /*101*/
  336. DEBFILE *FindExeOrDllWithSelOff( USHORT , USHORT );                     /*827*/
  337. void     dfilefree(void);
  338. void     afilefree(void);
  339. void     freepdf(DEBFILE *);
  340. void     FreeSyms( DEBFILE * );
  341. void     FreeTyps( DEBFILE * );
  342. void     FreePubs( DEBFILE * );
  343. int      DBGetAsmLines(AFILE *,uint,uint *,uint);                       /*530*/
  344. uchar    GetBitness(uint);                                              /*101*/
  345. ushort   MapAddrtoObjnum(DEBFILE *,uint,uint *);                        /*115*/
  346. int      MapFlatAddrToBase(DEBFILE *,ULONG,ULONG *,USHORT *,USHORT *);  /*827*/
  347. int      MapSelOffToBase(DEBFILE *,USHORT,USHORT,ULONG *,USHORT *);     /*827*/
  348. void     hexstr2higit( char *cp, char *phigit );                        /*827*/
  349. UCHAR   *GetCodeBytes( ULONG , UINT, UINT *  );                         /*827*/
  350. UCHAR   *GetDataBytes( ULONG , UINT, UINT *  );                         /*827*/
  351. void     GetMemoryBlocks( void );
  352. void     FreeMemBlks( void );
  353.  
  354. /*---------------------------------------------------------------------------*/
  355. /* File : RUN.C                                                              */
  356. /*---------------------------------------------------------------------------*/
  357. AFILE *Getfp_focus(void);
  358. void   Run( ULONG ,ULONG);
  359. void   TransLateRcToMessage(uint , char *);
  360. void   SetExecuteFlag( BOOL );
  361. BOOL   IsExecuteFlag( void );
  362.  
  363. /*---------------------------------------------------------------------------*/
  364. /* File : IDBRK.C                                                            */
  365. /*---------------------------------------------------------------------------*/
  366. uint     ParseNameAddr(char*, ULONG *, uchar *);
  367. APIRET   SetIDBrk( UCHAR *, int, int, char **);
  368. APIRET   ConvertDefBrks( PROCESS_NODE *,DEBFILE *,int);
  369. void     SaveBrks(PROCESS_NODE *);
  370. void     DisplayBkPntChoice( DIALOGSHELL *, DIALOGCHOICE * );
  371. BOOL     DoYouWantToDefer( void );
  372.  
  373. /*---------------------------------------------------------------------------*/
  374. /* File : FINDFP.C                                                           */
  375. /*---------------------------------------------------------------------------*/
  376. AFILE *findfp( ULONG instaddr );
  377. AFILE *mid2fp(uint);
  378. void  DropOrMakeFakefp(uint,uint,DEBFILE *);                            /*216*/
  379. AFILE *FindFuncOrAddr(uchar *,int);
  380.  
  381. /*---------------------------------------------------------------------------*/
  382. /* File : THREADS.C                                                          */
  383. /*---------------------------------------------------------------------------*/
  384. void    InitThreadList(void);
  385. void    FreeThreadList(void);
  386. void    SetThdDbgState(uint,uchar);
  387. uchar   GetThdDbgState(uint);
  388. uchar   GetThreadState(uint);
  389. void    BuildThreadList(void);
  390. int     IsRunnableThread(void);
  391. uint    RunThread(uint);
  392. TSTATE *GetThreadTSTATE( uint );
  393.  
  394. AFILE *showthds(uint *);                                                /*229*/
  395.  
  396.  
  397. /*---------------------------------------------------------------------------*/
  398. /* File : PAGEFP.C                                                           */
  399. /*---------------------------------------------------------------------------*/
  400. void pagefp(AFILE*,uint);
  401. void MarkLineBrksOK( DEBFILE *pdf,
  402.                      ULONG    mid,
  403.                      int      sfi,
  404.                      UCHAR   *srcbuf,
  405.                      USHORT  *offtab,
  406.                      UINT     FirstLineInSrcBuf,
  407.                      UINT     LastLineInSrcBuf);
  408.  
  409. /*---------------------------------------------------------------------------*/
  410. /* File : MAKEFP.C                                                           */
  411. /*---------------------------------------------------------------------------*/
  412. AFILE *makefp(DEBFILE *pdf, ULONG mid, ULONG instaddr, UCHAR *fname);
  413. AFILE *fakefp(UINT, UINT, DEBFILE *);
  414.  
  415. /*---------------------------------------------------------------------------*/
  416. /* File : LDSOURCE.C                                                         */
  417. /*---------------------------------------------------------------------------*/
  418. void  LoadSource(uchar *,uchar *,ushort *,uint,ushort *,uint *,uint *); /*101*/
  419. uint  FRopen(uchar*,uchar*,ushort);                                     /*100*/
  420. uint  FRclose(uchar*);                                                  /*101*/
  421. uchar *FRread(uchar*);                                                  /*101*/
  422.  
  423. /*---------------------------------------------------------------------------*/
  424. /* File : LDMSH.C                                                            */
  425. /*---------------------------------------------------------------------------*/
  426. void  LoadMSH   (        uchar *,ushort *,uint,ushort *,uint *,uint *); /*101*/
  427. /*---------------------------------------------------------------------------*/
  428. /* File : FREEFP.C                                                           */
  429. /*---------------------------------------------------------------------------*/
  430. void freefp(AFILE *);
  431.  
  432. /*---------------------------------------------------------------------------*/
  433. /* File : SHOWC.C                                                            */
  434. /*---------------------------------------------------------------------------*/
  435. uint    showC(AFILE *,uchar *);         /* chg to return uint.            521*/
  436. uint    dofwdtab(AFILE *,uchar *,uint);
  437. uint    dobwdtab(AFILE *,uchar *,uint);
  438. void    dohcsr(AFILE *,int);
  439. void    dohscr(AFILE *,int);
  440. void    dovcsr(AFILE *,int);
  441. void    dovscr(AFILE *,int);
  442. uint    IsOKchar(uchar);
  443. uint    IsOnCRT(AFILE *);
  444. int     ResizeWindow(AFILE *,int);      /* removed static                 701*/
  445. int     ShrinkStorage(AFILE *,uint);
  446. int     ExpandStorage(AFILE *,uint);
  447. void    SetCursorPos( void );                                           /*701*/
  448. int     GetEventView( void );                                           /*701*/
  449. void    SetSrcViewCsr( AFILE * );                                       /*701*/
  450. void    WaitForInterrupt( void * );
  451. void    ConnectThisPid( int );
  452.  
  453. /*---------------------------------------------------------------------------*/
  454. /* File : SHOWCF.C                                                           */
  455. /*---------------------------------------------------------------------------*/
  456. void   fmtscr(AFILE *);
  457. void   fmtfname(AFILE *);
  458. void   fmtpos(AFILE *);
  459. void   fmttxt(AFILE *);
  460.  
  461. AFILE *locatefp(uchar *,uint);
  462. uint   token(uchar *,uint, char *);
  463. DFILE *dumpvar(AFILE *, UCHAR *, UINT, UINT, UINT, AFILE **);
  464. void   RefreshSrcPart(AFILE *,int,int,int);
  465.  
  466. /*---------------------------------------------------------------------------*/
  467. /* File : TYPES.C                                                            */
  468. /*---------------------------------------------------------------------------*/
  469. UCHAR  *QtypeName(UINT ,USHORT );                                       /*813*/
  470. USHORT  QtypeNumber(UINT, UCHAR *, UINT *);
  471.  
  472. uint    QtypeSize(uint,USHORT);                                          /*813*/
  473. uint    QtypeGroup(uint,uint);
  474. Trec   *QtypeRec(uint,USHORT);                                           /*813*/
  475. Trec   *QbasetypeRec(uint,USHORT);                                       /*813*/
  476. int     QstructField(uint,uchar*,uint *,uint *);                         /*826*/
  477. int     QarrayItem(uint,uint,uint *,uint *);                             /*245*/
  478. int     QderefType(uint,USHORT *);                                       /*813*/
  479. ULONG   QNameList( Trec *, int , int );                                  /*813*/
  480. uint    HandleUserDefs(uint,uint);                                       /*512*/
  481. char   *QTagName( Trec * );
  482. USHORT  QtypeNumberAndMid( UCHAR *, UINT * );
  483. ULONG   QClassItemList( UINT mid, TD_TYPELIST *tp, int Request , int ItemNo );
  484. USHORT  Qbasetype(UINT mid, USHORT typeno);
  485.  
  486. /*---------------------------------------------------------------------------*/
  487. /* File : UNWIND.C                                                           */
  488. /*---------------------------------------------------------------------------*/
  489. uint   ActiveProcsMenu(AFILE **);
  490. uint   Cua_ActiveProcsMenu(AFILE **);
  491. void   SetActFrames(void);
  492. uint   StackFrameIndex(SCOPE);
  493. uint   StackFrameAddress(uint);                                         /*101*/
  494. void   FormatProcName(uchar *,uint,SCOPE,DEBFILE *,uchar,int);          /*824*/
  495. uint   DBDLLLoadInfo(uint,DEBFILE *);                                   /*107*/
  496. uchar  StackFrameMemModel(uint);                                        /*112*/
  497. char*  bcopy(char*,char*,uint);                                      /*215107*/
  498. uint   CsetThunk(uint * , uint *);                                      /*706*/
  499. void   SetShowAll( int );                                               /*701*/
  500. void   SetShowNamed( int );                                             /*701*/
  501.  
  502. /*---------------------------------------------------------------------------*/
  503. /* File : BOXMENU.C                                                          */
  504. /*---------------------------------------------------------------------------*/
  505. uint _System BoxMenu(uint,uint,uint,uint,BoxMenuData *);                /*521*/
  506. uint item2row(int,ulong);
  507.  
  508. /*---------------------------------------------------------------------------*/
  509. /* File : FINDEXEC.C                                                         */
  510. /*---------------------------------------------------------------------------*/
  511. AFILE *FindExecLine(AFILE *,uint);
  512. AFILE *FindExecAddr(AFILE *,uint);                                      /*107*/
  513. uint   IndexOfMidLnoForFrames(uint,uint);                               /*107*/
  514.  
  515. /*---------------------------------------------------------------------------*/
  516. /* File : SHOWD.C                                                            */
  517. /*---------------------------------------------------------------------------*/
  518. void   ShowData(uint);
  519. uint   ShowScalar(DFILE *,uint,uint,uint);
  520. uint   ShowConstant(DFILE *,uint,uint,uint);
  521. uint   ShowHexBytes(DFILE *,uint,uint,uint);
  522. uchar  graphic(uchar);
  523. void   InitDataBuffer(uchar *,uint,DFILE *);
  524. uchar *GetAppData(uint,uint,uint*,uint);                                /*101*/
  525. uint   StackBPRelToAddr(uint,uint);                                     /*112*/
  526. uint   BytesToValue(uint,uint,uint,uint,uint *);                        /*523*/
  527.  
  528. /*---------------------------------------------------------------------------*/
  529. /* File : SHOWDK.C                                                           */
  530. /*---------------------------------------------------------------------------*/
  531. typedef int (* SIZEFUNC)(AFILE *,int);                                  /*521*/
  532. void   InitDataWinCsr(void);                                            /*701*/
  533. int    typoS(SIZEFUNC, AFILE *, AFILE **);
  534. DFILE *AppendDataFile(DFILE *);
  535. void   InsDataFile(uint,DFILE * );
  536. void   SetShowType(DFILE *,uint);                                       /*101*/
  537. void   QueueDrec(DFILE *);
  538. void   DropDrec(DFILE *);
  539. void   DelDataFile(uint);
  540. int    SetShowLines(DFILE *);
  541. uchar *ZapExpr(uint,uchar *,uint *,AFILE *);
  542. DFILE *FindDrec(uint);
  543. DFILE *FindNearDrec(uint);
  544. void   SetType(DFILE *);                                                /*813*/
  545. void  SetDataViewCsr( void );                                           /*701*/
  546. /*---------------------------------------------------------------------------*/
  547. /* File : SHOWDX.C                                                           */
  548. /*---------------------------------------------------------------------------*/
  549. uint ZapHexBytes(DFILE *,uint,uint);
  550. void FmtAdrBox(uchar *,uint);
  551. int  x2tou(uchar *,uchar *);
  552. int  GetIthHexField( PEVENT );                                           /*701*/
  553. int  GetStorageArea( PEVENT );                                           /*701*/
  554.  
  555. /*---------------------------------------------------------------------------*/
  556. /* File : SHOWDZ.C                                                           */
  557. /*---------------------------------------------------------------------------*/
  558. uint ZapPointer(DFILE *,uint,uint);                                     /*521*/
  559. int  _System KeyPointer(uint,uint,uint,uint,uint,uint);                 /*521*/
  560. uint x4tou(uchar *,ushort *);
  561. uint x8tou(uchar *,uint *);                                             /*108*/
  562. uint ZapScalar(DFILE *,uint,uint);                                      /*521*/
  563. int  _System KeyScalar(uint,uint,uint,uint,uint,uint);                  /*521*/
  564. int  ParseScalar(uchar *,uint,ulong *);
  565. int  PutAppData(uint,uint,uchar *,uint);
  566. uint ZapHexWord(uint,uint,uchar *);                                     /*226*/
  567. uint ZapHexDWord(uint,uint,uchar *);                                    /*226*/
  568.  
  569. ulong cvtnum(uchar *,uint );            /* moved here.                    521*/
  570.  
  571. /*---------------------------------------------------------------------------*/
  572. /* File : SHOWD2.C                                                           */
  573. /*---------------------------------------------------------------------------*/
  574. uint    ShowStruct(DFILE *,uint,uint,uint);                             /*521*/
  575. uint    ZapStruct(DFILE *,uint,uint);                                   /*521*/
  576. uint    ShowArray(DFILE *,uint,uint,uint);                              /*521*/
  577. uint    ZapArray(DFILE *,uint,uint);                                    /*521*/
  578. UINTFUNC PickKeyer(uint,uint);                                          /*112*/
  579. uint     FalseKeyer(void);
  580.  
  581. /*---------------------------------------------------------------------------*/
  582. /* File : SHOWDF.C                                                           */
  583. /*---------------------------------------------------------------------------*/
  584. void   fmtdwinstat(uint,int);
  585.  
  586. /*---------------------------------------------------------------------------*/
  587. /* File : EXPR.C                                                             */
  588. /*---------------------------------------------------------------------------*/
  589. UCHAR *ParseExpr(UCHAR *, uint, uint, uint, int sfi);
  590. uint   GetAbsAddr(uint,uint,uint *);
  591. uint   ParseArrayIndex(uchar *,uint,uint, int sfi, uint *);
  592.  
  593. /*---------------------------------------------------------------------------*/
  594. /* File : SYMBOLS.C                                                          */
  595. /*---------------------------------------------------------------------------*/
  596. uchar    *CopyProcName(void *,uchar *,uint);
  597. void     *FindScope(uint,uint *);
  598. void     *LocateScope(uint,uint,DEBFILE *);
  599. uint     findlvar(uint,uchar *,uint, int sfi, BOOL *this);
  600. uint     findsvar(uint,uchar *);
  601. SSRec    *Qsymbol( uint mid, uint lno, int sfi, uchar *vsym );
  602. uchar    *findsym(uchar *,uchar **,uchar*);
  603.  
  604. /*---------------------------------------------------------------------------*/
  605. /* File : DBSEGS.C                                                           */
  606. /*---------------------------------------------------------------------------*/
  607. SSRec   *DBSymSeg(uint, ULONG *, DEBFILE *);
  608. uchar   *DBTypSeg(uint,uint *,DEBFILE *);
  609. uchar   *DBPubSeg(uint,uint *,DEBFILE *);
  610. uchar    IsSymSeg32(uchar *SymSegPtr);
  611.  
  612. /*---------------------------------------------------------------------------*/
  613. /* File : SD86PRO.C                                                          */
  614. /*---------------------------------------------------------------------------*/
  615. void Profile( KEY2FUNC[]);
  616. void HelpScreen(void);
  617. uint HelpDialogFunction( DIALOGSHELL *, DIALOGCHOICE *, EVENT *, void * );
  618. void DisplayHelpChoice( DIALOGSHELL *, DIALOGCHOICE * );
  619.  
  620. /*---------------------------------------------------------------------------*/
  621. /* File : SHOWA.C                                                            */
  622. /*---------------------------------------------------------------------------*/
  623. uint showA(AFILE *,uchar *);
  624. int  Recalibrate(AFILE *,int);
  625. void SetAsmViewCsr( AFILE *, uint * );                                  /*701*/
  626.  
  627. /*---------------------------------------------------------------------------*/
  628. /* File : SCROLLA.C                                                          */
  629. /*---------------------------------------------------------------------------*/
  630. uint ascroll(AFILE *,int);                                              /*235*/
  631. uint IsOnAsmCRT(uint);                                                  /*235*/
  632. void RefreshAsmPart(int,int);                                           /*519*/
  633. void FreeDisasmViewBuffers(void);                                       /*813*/
  634.  
  635. /*---------------------------------------------------------------------------*/
  636. /* File : SHOWAF.C                                                           */
  637. /*---------------------------------------------------------------------------*/
  638. void   fmtasm(AFILE *);
  639. void   utox2(uchar,uchar *);                                            /*213*/
  640. void   utox4(uint,uchar *);
  641. void   utox8(uint,uchar *);                                             /*112*/
  642. uint   atou(uchar *);
  643. void   fmtthread(void);
  644.  
  645. /*---------------------------------------------------------------------------*/
  646. /* File : MENU.C                                                             */
  647. /*---------------------------------------------------------------------------*/
  648. uint MenuBar(uchar *,uchar *, ULONG *,uchar *,uint *,uint,uint);
  649.  
  650. /*---------------------------------------------------------------------------*/
  651. /* File : ACTBAR.C                                                           */
  652. /*---------------------------------------------------------------------------*/
  653. int   scan(AFILE *,uchar *);                                            /*701*/
  654.  
  655. /*---------------------------------------------------------------------------*/
  656. /* File : DISASM.C                                                           */
  657. /*---------------------------------------------------------------------------*/
  658. int    DBDisa(uint,uint,uint,int);
  659. void  *instdelta(void*,int,uint,uint);
  660. uint   rollback(uint,int,uint);         /* 1st parm uint last parm dropped107*/
  661. int    cache(uint,uint);                /* 1st parm changed to uint.      235*/
  662. void   GetInstrPacket(uint,DTIF *);     /* 1st parm changed to uint.      101*/
  663. uchar  InstLength(uint);                /* replaced InstLength & InstLem  101*/
  664. uchar  InstLengthGlob(uchar*,uchar);    /* to expedite consecutive calls  107*/
  665. int    FindAddrInCache( uint addr );    /*                                235*/
  666.  
  667. /*---------------------------------------------------------------------------*/
  668. /* File : CBRK.C                                                             */
  669. /*---------------------------------------------------------------------------*/
  670. int    EvalCbrk(BRKCOND *);
  671. uchar *ParseCbrk(BRKCOND *,uint,uint, int sfi);
  672. uchar *ParseDbrk(uchar *);
  673. int    SetHardBreak(void);
  674. int    ResetHardBreak(void);
  675.  
  676. /*---------------------------------------------------------------------------*/
  677. /* File : DLL.C                                                              */
  678. /*---------------------------------------------------------------------------*/
  679. APIRET dllinit(HMODULE,char *,OBJTABLEENTRY *);
  680.  
  681. /*---------------------------------------------------------------------------*/
  682. /* File : EXE.C                                                              */
  683. /*---------------------------------------------------------------------------*/
  684. ULONG exeinit(HMODULE,char *,OBJTABLEENTRY *);                          /*822*/
  685.  
  686. /*---------------------------------------------------------------------------*/
  687. /* File : ASMINIT.C                                                          */
  688. /*---------------------------------------------------------------------------*/
  689. void  asminit(DEBFILE * );
  690.  
  691. /*---------------------------------------------------------------------------*/
  692. /* File : DEBFILE.C                                                          */
  693. /*---------------------------------------------------------------------------*/
  694. APIRET  debfileinit(DEBFILE *) ;
  695. void    InitModules(char *, int, DEBFILE *);
  696. APIRET  InitModuleAddrs( DEBFILE *);
  697. void    SetDebugFormatFlags(char *, int, DEBFILE *);
  698. MODULE *GetModulePtr(ULONG, DEBFILE *);
  699. APIRET  FindDebugStart( HFILE, ULONG *, int *, int *);
  700. ULONG   FindOS2hdr(DEBFILE *);
  701.  
  702. /*---------------------------------------------------------------------------*/
  703. /* File : FINDFILE.C                                                         */
  704. /*---------------------------------------------------------------------------*/
  705. void  findsrc( char *, char *, uint);
  706. UINT  FindExe( char *, char *, UINT);
  707.  
  708. /*---------------------------------------------------------------------------*/
  709. /* File : ZOOMDATA.C                                                         */
  710. /*---------------------------------------------------------------------------*/
  711. uint  zoomrec(AFILE *, DFILE *, int, AFILE **);
  712.  
  713. /*---------------------------------------------------------------------------*/
  714. /* File : BROWSE.C                                                           */
  715. /*---------------------------------------------------------------------------*/
  716. int   browse(char *, int);
  717. void  scrollwindow(AFILE *,int);
  718. void  scrollfile(AFILE *,uint);
  719.  
  720.  
  721. /*---------------------------------------------------------------------------*/
  722. /* File : FINDPRO.C                                                          */
  723. /*---------------------------------------------------------------------------*/
  724. void  findpro(char *,char *,uint);
  725.  
  726. /*---------------------------------------------------------------------------*/
  727. /* File : VIEWASM.C                                                          */
  728. /*---------------------------------------------------------------------------*/
  729. void   buildasmline(uchar *,INSTR *);                    /* return void   108*/
  730. void   buildopnd(uchar *,INSTR *);
  731. void   buildsyms(uchar,int);
  732. uint   selreg(uint);
  733. uint   offreg(uint);
  734. ULONG  BaseVal(INSTR *);
  735. uchar* grabopnd(INSTR *,uint);
  736. void   buildsidesrc(uchar *,AFILE *,uint);
  737. void   buildasmsrc(uchar *,AFILE *,uint);
  738.  
  739. /*---------------------------------------------------------------------------*/
  740. /* File : TERM.C                                                             */
  741. /*---------------------------------------------------------------------------*/
  742. void Restart(void);
  743. int  NormalQuit(int);                                                   /*710*/
  744. int  GoTerm( void );                                                    /*710*/
  745. void PostWait4DbgQueTermSema4( void );                                  /*919*/
  746.  
  747. /*---------------------------------------------------------------------------*/
  748. /* File : SHOWDLLS.C                                                         */
  749. /*---------------------------------------------------------------------------*/
  750. void ShowDlls(void);
  751. void DisplayDllChoice (DIALOGSHELL *,DIALOGCHOICE *);                   /*701*/
  752. uint DllDialogFunction( DIALOGSHELL *, DIALOGCHOICE *, EVENT *, void * );
  753.  
  754. /*---------------------------------------------------------------------------*/
  755. /* File : GETFILE.C                                                          */
  756. /*---------------------------------------------------------------------------*/
  757. AFILE* GetFile( uchar * );
  758.  
  759. /*---------------------------------------------------------------------------*/
  760. /* File : SETCOLOR.C                                                         */
  761. /*---------------------------------------------------------------------------*/
  762. void SetColors(void);
  763. void RefreshColors(uint,uint,uint,uint);
  764. uint SaveColors(uchar *);
  765. void DisplayColorChoice(DIALOGSHELL *,DIALOGCHOICE *);                  /*701*/
  766. void ReDisplaySingleColor(uint,uint,uint,uchar *);                      /*701*/
  767. void SetDefaultColorMap(void);                                          /*701*/
  768. uint GetEventPositionInDialog( DIALOGSHELL *, DIALOGCHOICE *, uint *, uchar );
  769.                                                                         /*701*/
  770. uint ColorDialogFunction( DIALOGSHELL *, DIALOGCHOICE *, EVENT *, void * );
  771.  
  772. /*---------------------------------------------------------------------------*/
  773. /* File : SETEXCEP.C                                                         */
  774. /*---------------------------------------------------------------------------*/
  775. void SetExceptions(void);                                               /*308*/
  776. void RefreshExceptions(uint,uint,uint,uint);                            /*308*/
  777. uint SaveExceptions(uchar *);                                           /*308*/
  778. void DisplayExcepChoice (DIALOGSHELL *,DIALOGCHOICE *);                 /*701*/
  779. void SetDefaultExcepMap(void);                                          /*701*/
  780. uint ExcepDialogFunction( DIALOGSHELL *, DIALOGCHOICE *, EVENT *, void * );
  781.  
  782. /*---------------------------------------------------------------------------*/
  783. /* File : MAPLINES.C                                                      813*/
  784. /*---------------------------------------------------------------------------*/
  785. LINNUM_ENTRY *MapHL04LineNumbers( LINE_NUMBER_TABLE_ENTRY_HL04 *,
  786.                                   USHORT,
  787.                                   USHORT*,
  788.                                   ULONG);
  789.  
  790. void    MapCV16LineNumbers( uint *, uint *, uint, ushort );
  791. void    MapCV32LineNumbers( uint *, uint *, uint, ushort );
  792. void    MapT105LineNumbers( uint *, uint *, uint );
  793. USHORT  MapHLLLineNumbers( uint *, uint *, uint, MODULE * );
  794. int     compare( const void *key, const void *element);
  795. int     ucompare( const void *key, const void *element);
  796.  
  797. /*---------------------------------------------------------------------------*/
  798. /* File : MAPTYPES.C                                                      813*/
  799. /*---------------------------------------------------------------------------*/
  800. uchar *MapHLLTypes( uchar *RawTable, MODULE *mptr );
  801. uchar *MapMSTypes( uchar *RawTable, MODULE *pModule );
  802. uchar *GetField( uchar *, void *, uint * );
  803. ushort GetInternal0_16PtrIndex( ushort TypeIndex );
  804. USHORT GetEncLength( ENCLEN *pEncLen, int *pNumBytes );
  805. BOOL   IsVirtual( HL_MEMFNC *pHLLMemFnc );
  806. BOOL   IsStatic( HL_CLSMEM *pHLLClsMem );
  807. BOOL   IsVtable( HL_CLSMEM *pHLLClsMem );
  808.  
  809. /*---------------------------------------------------------------------------*/
  810. /* File : MAPSYMS.C                                                       813*/
  811. /*---------------------------------------------------------------------------*/
  812. void  MapHLLSyms( uchar *, SSRec *, MODULE * );                         /*809*/
  813. void  MapMS16Syms( uchar *RawTable, SSRec *IntSymTable, uint symlen );  /*809*/
  814. void  MapMS32Syms( uchar *RawTable, SSRec *IntSymTable, uint symlen );  /*809*/
  815. ushort  GetRecordLength( uchar *, MODULE * );                           /*809*/
  816. uchar   GetRecordType( uchar *, MODULE * );                             /*809*/
  817.  
  818. /*---------------------------------------------------------------------------*/
  819. /* File : POINTER.C                                                          */
  820. /*---------------------------------------------------------------------------*/
  821. UINT  GetPtrType(uint,USHORT );                                         /*813*/
  822. uint  DerefPointer(uint,uint);                                   /*240*//*112*/
  823. uint  ResolveAddr(uint,DFILE *,uint);                                   /*219*/
  824.  
  825. /*---------------------------------------------------------------------------*/
  826. /* File : SHOWVREG.C                                                      400*/
  827. /*---------------------------------------------------------------------------*/
  828. void   ShowvRegs(void);                                                 /*400*/
  829. AFILE *KeyvRegs(uint *);                                                /*400*/
  830. uint   _System ZapvRegs(void);                                      /*521 400*/
  831. void   GetScrAccess(void);                                              /*400*/
  832. void   SetScrAccess(void);                                              /*400*/
  833. void   SetRegChgMask(void);                                             /*400*/
  834. uint   SetExecLine(uint );                                              /*508*/
  835.  
  836. /*---------------------------------------------------------------------------*/
  837. /* File : SHOWCORG.C                                                      401*/
  838. /*---------------------------------------------------------------------------*/
  839. void   ShowCoRegs(void);                                                /*401*/
  840. void   Converttox(uchar *,uchar *);                                     /*401*/
  841. void   FillIn(uchar *,uchar );                                          /*401*/
  842.  
  843. /*---------------------------------------------------------------------------*/
  844. /* Proto types for 16 bit DosAllocSeg, DosReallocSeg and DosFreeseg       521*/
  845. /*---------------------------------------------------------------------------*/
  846. #define DosAllocSeg     DOS16ALLOCSEG
  847. #define DosFreeSeg      DOS16FREESEG
  848. #define DosReallocSeg   DOS16REALLOCSEG
  849.  
  850. APIRET16  APIENTRY16 DosAllocSeg(USHORT cbSize, PSEL pSel, USHORT fsAlloc);
  851. APIRET16  APIENTRY16 DosFreeSeg(SEL sel);
  852. APIRET16  APIENTRY16 DosReallocSeg(USHORT cbNewSize, SEL sel);
  853.  
  854. /*---------------------------------------------------------------------------*/
  855. /* File : SETWPS.C                                                        602*/
  856. /*---------------------------------------------------------------------------*/
  857. void  SetWps(AFILE *);                                                  /*602*/
  858. uchar EncodeSize(uint);                                                 /*602*/
  859. uchar AlignAddress(uint *,uchar);                                       /*602*/
  860. void  PutInWps(void);                                                   /*602*/
  861. uint  PullOutWps(DEBUG_REGISTER *);                                     /*602*/
  862. void  ResetWp(uint);                                                    /*602*/
  863. int   IsWatchPoint( void );
  864.  
  865. /*---------------------------------------------------------------------------*/
  866. /* File : ALLOCTXT.C                                                      606*/
  867. /*---------------------------------------------------------------------------*/
  868. void AddModuleToPdf(DEBFILE *,MODULE *,ushort,uint,uint);               /*606*/
  869.  
  870. /*---------------------------------------------------------------------------*/
  871. /* File : acvt.c                                                          607*/
  872. /*---------------------------------------------------------------------------*/
  873. void  Data_Flat2SelOff(ULONG addr,USHORT *pSelector,USHORT *pOffset);
  874. ULONG Data_SelOff2Flat (USHORT Selector, USHORT Offset);
  875. void  Code_Flat2SelOff(ULONG addr,USHORT *pSelector,USHORT *pOffset);
  876. ULONG Code_SelOff2Flat (ushort Selector,ushort Offset);
  877.  
  878. /*---------------------------------------------------------------------------*/
  879. /* File : Dialog.c                                                           */
  880. /*---------------------------------------------------------------------------*/
  881. void  windowsv(int,int,int,int,char *);                                 /*701*/
  882. void  windowrst(int,int,int,int,char *);                                /*701*/
  883. void  DisplayDialog(DIALOGSHELL *, int );                               /*701*/
  884. void  RemoveDialog(DIALOGSHELL *);                                      /*701*/
  885. uchar VerifyMouseinDialog (DIALOGSHELL *,DIALOGCHOICE *,uint *,int *);  /*701*/
  886. uchar VerifyMouseinDialogButtons (DIALOGSHELL *,uint *);                /*701*/
  887. UINT  ProcessDialog( DIALOGSHELL *, DIALOGCHOICE *, uchar, void * );     /*701*/
  888. UINT  ProcessYesNoBox( DIALOGSHELL *, DIALOGCHOICE * );
  889.  
  890. /*---------------------------------------------------------------------------*/
  891. /* File : popup.c                                                            */
  892. /*---------------------------------------------------------------------------*/
  893. void    DisplayPop(POPUPSHELL * );                                      /*701*/
  894. uint    GetPopStr(POPUPSHELL *,uint,uint,uint,uchar *);                 /*701*/
  895. BUTTON *GetButtonPtr (POPUPSHELL *, PEVENT);                            /*910*/
  896. void    stripblk (uchar *);                                             /*701*/
  897. void    GetPopArea( char * );                                           /*701*/
  898. void    PutPopArea( char * );                                           /*701*/
  899.  
  900. /*---------------------------------------------------------------------------*/
  901. /* File : Mouse.c                                                            */
  902. /*---------------------------------------------------------------------------*/
  903. void   AccessMouse( void );
  904. PEVENT GetEvent( uint );
  905. PEVENT GetCurrentEvent( void );
  906. void   HideMouse(void);
  907. void   ShowMouse(void);
  908. void   CloseMouse(void);
  909. void   MouseThread(void *);
  910. void   KbdThread(void *);
  911. void   StartThreads( void );
  912. void   CloseEventSemaphores(void);
  913.  
  914. /*---------------------------------------------------------------------------*/
  915. /* File : Cuamenu.c                                                          */
  916. /*---------------------------------------------------------------------------*/
  917. int   CuaMenuBar( int , void *);
  918. void  DisplayMenu( void );
  919. int   GetEventPositionInMenu( int , int * );
  920. int   MouseEventInActionBar( int  * );
  921. int   MouseEventInPulldown( int , int  * );
  922. int   MouseEventInArrow( PULLDOWN *, int );
  923. void  RemoveMenuCursor( int  );
  924. void  DisplayMenuCursor( int  );
  925. void  DisplayPullCursor( int , int  );
  926. void  RemovePullCursor( int , int  );
  927. void  DisplayPulldown( int  );
  928. void  RemovePulldown( int  );
  929. void  AdjustPulldownMask( AFILE * );
  930. void  UpdatePullDownsWithAccelKeys( void );
  931. int   HandleMouseEvent( void );
  932. int   HandleKbdEvent( void ) ;
  933. uint  KeyInActionBarExpressKeys( int * );
  934. void  DisplayCasPulldown( CAS_PULLDOWN );
  935. int   GetCasPulldownChoice( CAS_PULLDOWN *, int *, int * );
  936. int   GetPulldownChoice( int, int *, int *, int );
  937. int   GetActionbarChoice( int *, int *, int *, int * );
  938. int   GetObjectPullChoice( int, int * );
  939. int   IsSwapFlag( int );
  940. void  SetSelectMask( int , int, int );
  941. void  SetMenuMask( int );
  942. PULLDOWN  *GetPullPointer( int );
  943.  
  944. void  DisableDropFile( void );
  945. void  EnableDropFile ( void );
  946. void  ReSetSelectBit ( int PullIndex, int PullChoiceIndex );
  947. void  SetSelectBit   ( int PullIndex, int PullChoiceIndex );
  948.  
  949. /*---------------------------------------------------------------------------*/
  950. /* File : Cuashowa.c                                                         */
  951. /*---------------------------------------------------------------------------*/
  952. uint Cua_showA(AFILE *,uchar *);                                        /*701*/
  953.  
  954. /*---------------------------------------------------------------------------*/
  955. /* File : CuaMap.c                                                           */
  956. /*---------------------------------------------------------------------------*/
  957. int  GetFuncsFromEvents( int , void * );                                /*701*/
  958.  
  959. /*---------------------------------------------------------------------------*/
  960. /* File : Cuasetwp.c                                                         */
  961. /*---------------------------------------------------------------------------*/
  962. void  Cua_SetWps(AFILE *);                                              /*701*/
  963. void  DisplayWhPntChoice (DIALOGSHELL *,DIALOGCHOICE *);                /*701*/
  964. uint  GetDialogWhPntChoice (DIALOGSHELL *,DIALOGCHOICE *,AFILE *);      /*701*/
  965.  
  966. /*---------------------------------------------------------------------------*/
  967. /* File : Cuathds.c                                                          */
  968. /*---------------------------------------------------------------------------*/
  969. AFILE *Cua_showthds(void);                                              /*701*/
  970. void   DisplayThdsChoice (DIALOGSHELL *,DIALOGCHOICE *);                /*701*/
  971. uint   ThreadsDialogFunction( DIALOGSHELL *, DIALOGCHOICE *, EVENT *, void * );
  972.  
  973. /*---------------------------------------------------------------------------*/
  974. /* File : cuaproc.c                                                          */
  975. /*---------------------------------------------------------------------------*/
  976. void   Cua_showproc( void );
  977. void   DisplayProcChoice( DIALOGSHELL *, DIALOGCHOICE * );
  978. uint   ProcessDialogFunction( DIALOGSHELL *, DIALOGCHOICE *, EVENT *, void * );
  979.  
  980. /*---------------------------------------------------------------------------*/
  981. /* File : Cuaclstk.c                                                         */
  982. /*---------------------------------------------------------------------------*/
  983. void DisplayClstkChoice (DIALOGSHELL *,DIALOGCHOICE *);                 /*701*/
  984. uint ClstkDialogFunction( DIALOGSHELL *, DIALOGCHOICE *, EVENT *, void * );
  985.  
  986. /*---------------------------------------------------------------------------*/
  987. /* File : Action.c                                                        701*/
  988. /*---------------------------------------------------------------------------*/
  989. AFILE       *GetFunction( char* , uint );
  990. AFILE       *GetF( void );
  991. void         FindStr( AFILE *);
  992. int          ScanStr( AFILE *);
  993. void         BrowseFile( void);
  994. void         SetCondBrk( AFILE *, uint , uchar * );
  995. uint         PopPrompt( char *, char *);
  996. void         SetNameOrAddrBkpt( AFILE *, uint );
  997. int          GetLineNumber( char );
  998. UINT         GetFormatType( DFILE * );
  999.  
  1000. /*---------------------------------------------------------------------------*/
  1001. /* File : Import.c                                                           */
  1002. /*---------------------------------------------------------------------------*/
  1003. uint     ResolveImport( char *, DEBFILE * );
  1004. uint     ResolveImport32( char *, DEBFILE *, uchar * );
  1005. DEBFILE *findpdf( char * );
  1006. uint     findexport( DEBFILE *, char * );
  1007. uint     findexport32( DEBFILE *, char * );
  1008. int      PassbyImportByOrdFix( int, int, int );
  1009. int      PassbyImportByNameFix( int, int, int );
  1010. int      PassbyInternalEntFix( int, int, int );
  1011. int      PassbyInternalFix( int, int, int );
  1012. int      FindImportName( char *, DEBFILE *, ulong, int );
  1013.  
  1014. #endif /* end of INCL_FUNCS */                                          /*813*/
  1015. /*---------------------------------------------------------------------------*/
  1016. /* File : okeystr.c                                                          */
  1017. /*---------------------------------------------------------------------------*/
  1018. #if 0
  1019. uint         keystr(uint,uint,uint,uint *,uchar *, uint);
  1020. static uint  FldUsed(void);
  1021. static uchar shiftRight(void);
  1022. static void  shiftLeft(void);
  1023. static int   Left(uint);
  1024. static int   Right(uint);
  1025. static int   Home(uint);
  1026. static int   End(uint);
  1027. static int   Insert(uint);
  1028. static int   Delete(uint);
  1029. static int   Backspace(uint);
  1030. static int   Default(uint);
  1031. static void  keybeep(void);
  1032.  
  1033. #endif
  1034.  
  1035. /*---------------------------------------------------------------------------*/
  1036. /* fmtdata.c defined functions.                                              */
  1037. /*---------------------------------------------------------------------------*/
  1038. #ifdef INCL_FMTDATA
  1039.  void   FormatDataItem(UCHAR *,UINT,UINT,USHORT,UINT);
  1040.  void   FmtChar( char *, ULONG , UINT, USHORT);
  1041.  void   FmtShort( char *, ULONG , UINT, USHORT);
  1042.  void   FmtLong( char *, ULONG , UINT, USHORT);
  1043.  void   FmtFloat( UINT, char *, ULONG , UINT, USHORT);
  1044.  USHORT FmtPtr( char **, ULONG*, UINT, USHORT, UINT);
  1045.  void   FmtBytes( char *, ULONG , UINT , UINT );
  1046.  void   FmtString( char *, char *,ULONG, UINT );
  1047.  USHORT FmtEnums( Trec *,char **, ULONG , UINT , USHORT, UINT );
  1048.  void   FmtBitField(Trec *, char *, ULONG,  UINT);
  1049.  void   FmtMemFncAttrs( Trec *pTrec, UCHAR *cp );
  1050.  void   FmtClsMemAttrs( Trec *pTrec, UCHAR *cp );
  1051.  void   FmtBseClsAttrs( Trec *pTrec, UCHAR *cp );
  1052.  void   FmtClsDefAttrs( Trec *pTrec, UCHAR *cp );
  1053.  void   FmtRef( char *cp, ULONG UserAddr, UINT sfx );
  1054.  void   FmtFriendAttrs( Trec *pTrec, UCHAR *cp );
  1055. #endif
  1056.  
  1057. /*---------------------------------------------------------------------------*/
  1058. /* mte.c defined functions.                                                  */
  1059. /*---------------------------------------------------------------------------*/
  1060. #ifdef INCL_MTE
  1061.  void   *UpdateMteTable( UINT*);
  1062.  void    MarkTheFreedMtes( UINT );
  1063.  void    AddObjectsToMteTable( UINT , OBJTABLEENTRY * );
  1064.  APIRET  ExeDllInit( UINT * );
  1065.  ULONG   GetLoadAddr( ULONG , UINT );
  1066.  void    FreeMteTable( void );
  1067.  void    CopySharedMteTab( ULONG *);
  1068.  void    FreeMte( HMODULE );
  1069. #endif
  1070.  
  1071.  
  1072. /*---------------------------------------------------------------------------*/
  1073. /* File : BRK.C                                                              */
  1074. /*---------------------------------------------------------------------------*/
  1075. #ifdef INCL_BRK
  1076. BRK    *DefBrk(ULONG,int);
  1077. void    UndBrk(ULONG,int);
  1078. void    FreeAllBrks(void);
  1079. void    UnMarkLineBRKs(AFILE *);
  1080. void    DropBrk(AFILE *,BRK *);
  1081. void    DropOnceBrks(UINT);
  1082. void    SetAddrBRK(AFILE *, ULONG address, int );
  1083. char   *SetLineBRK(AFILE *, UINT, UCHAR *, UINT, char *);
  1084. void    MarkLineBRKs(AFILE *);
  1085. BRK    *IsBrk(AFILE *,UINT);
  1086. BRK    *IfBrkOnAddr(UINT);
  1087. int     IsDeferredBrk( void );
  1088. #endif
  1089.  
  1090.  
  1091. /*---------------------------------------------------------------------------*/
  1092. /* File : GO.C                                                               */
  1093. /*---------------------------------------------------------------------------*/
  1094. #ifdef INCL_GO                                                          /*827*/
  1095. APIRET  GoInit( ULONG, ULONG );                                         /*827*/
  1096. APIRET  GoEntry( void );
  1097. int     Go(UINT);                                                       /*827*/
  1098. APIRET  GoFast(int);                                                    /*827*/
  1099. APIRET  GoStep(int,int);                                                /*827*/
  1100. TSTATE *GetExecThread(void);                                            /*919*/
  1101. AFILE  *GetExecfp(void);                                                /*919*/
  1102. ULONG   GetExecTid(void);                                               /*919*/
  1103. ULONG   GetExecAddr(void);                                              /*919*/
  1104. LNOTAB *GetExecLnoTabEntry(void);
  1105. ULONG   GetExecLno(void);                                               /*919*/
  1106. ULONG   GetExecMid(void);                                               /*919*/
  1107. void    SetExecAddr( ULONG );                                           /*919*/
  1108. void    SetExecValues( ULONG , int );                                   /*919*/
  1109. AFILE  *SetExecfp( void );                                              /*919*/
  1110. #endif
  1111. /*---------------------------------------------------------------------------*/
  1112. /* debug.c    defined functions.                                             */
  1113. /*---------------------------------------------------------------------------*/
  1114. #ifdef INCL_DEBUG
  1115.  void  DumpModuleLoadTable( UINT * );
  1116.  void  DumpMteTable( void * );
  1117.  void  DumpPubRec16( void * );
  1118.  void  DumpObjectTable( DEBFILE *);
  1119.  void  DumpUnwindTables( void );
  1120.  void  DumpLineNums( MODULE *pModule );
  1121.  void  DumpCache( INSTR *);
  1122.  void  DumpSourceLineCache( UINT  *);
  1123.  void  DumpModuleStructure( void * );
  1124.  void  DumpAfileStructure( void * );
  1125.  void  DumpString( void *);
  1126.  void  DumpINSTRStructure( void *);
  1127.  void  DumpTSTATEStructure( void *);
  1128.  void  DumpFILE( void * );
  1129.  void  DumpEntryList(void*,int);
  1130.  void  DumpQue( void *,void *);
  1131.  void  DumpCsectMap( MODULE*pm, CSECTMAP *pc, int type);
  1132.  void  DumpClassRecord( TD_CLASS *pClassRecord );
  1133.  void  DumpMemFncRecord( TD_MEMFNC *pMemFncRecord );
  1134.  void  DumpBseClsRecord( TD_BSECLS *pIntBseCls );
  1135. #endif
  1136.  
  1137. /*---------------------------------------------------------------------------*/
  1138. /* xbox.c defined functions.                                              827*/
  1139. /*---------------------------------------------------------------------------*/
  1140. #ifdef INCL_XBOX
  1141.  APIRET xFindExe(char *,char *,UINT );
  1142.  APIRET xStartUser(char * ,
  1143.                    char * ,
  1144.                    USHORT ,
  1145.                    ULONG *,
  1146.                    ULONG *,
  1147.                    ULONG *,
  1148.                    ULONG  ,
  1149.                    char * );
  1150.  
  1151.  APIRET xGoInit( PtraceBuffer *,ULONG *,UINT ** , int* );
  1152.  APIRET xGoEntry( PtraceBuffer  *,ULONG *,UINT **,int *,ULONG,int );
  1153.  void   xDefBrk( ULONG );
  1154.  void   xUndBrk( ULONG );
  1155.  void   xPutInBrk( ULONG );
  1156.  void   xPullOutBrk( ULONG);
  1157.  void   xInsertAllBrk(void);
  1158.  void   xRemoveAllBrk(void);
  1159.  APIRET APIENTRY xDosDebug(PtraceBuffer *);
  1160.  ULONG  xGetThreadInfo(THREADINFO *);
  1161.  void   xFreezeThread(ULONG);
  1162.  void   xThawThread(ULONG);
  1163.  ULONG  xGetCallStack(STACK_PARMS *,UCHAR **,UINT **,UINT ** );
  1164.  ULONG  xGetExeOrDllEntryOrExitPt( UINT );
  1165.  APIRET xNormalQuit( int, UINT, ULONG);
  1166.  APIRET xSetExecAddr(ULONG );
  1167.  void   xDefWps( void *, int);
  1168.  void   xPutInWps( ULONG *);
  1169.  void   xPullOutWps( void );
  1170.  UCHAR *xGetMemoryBlock( ULONG , int , int * );
  1171.  void  *xGetMemoryBlocks(void *,int );
  1172.  void   xSetExceptions( UCHAR *,int );
  1173.  APIRET xSetExecThread(ULONG *,PtraceBuffer *, UINT );
  1174.  APIRET xWriteRegs(ULONG *,PtraceBuffer *);
  1175.  APIRET xGetCoRegs(void * );
  1176.  
  1177.  APIRET xGoStep(PtraceBuffer*,ULONG*,UINT **,int *,ULONG,ULONG,ULONG,int,int);
  1178.  APIRET xGoFast( PtraceBuffer  *,ULONG *,UINT **,int *,ULONG,int );
  1179.  void   xTerminateESP( void );
  1180.  void   xSetEspRunOpts( ESP_RUN_OPTS *);                                /*919*/
  1181.  void   xSendCtrlBreak( LHANDLE, USHORT );                              /*919*/
  1182.  APIRET xStartEspQue( void );                                           /*919*/
  1183.  void   xStartQueListenThread( void );                                  /*919*/
  1184.  void   xConnectEsp( LHANDLE, USHORT );                                 /*919*/
  1185.  void   xSendKillListen( LHANDLE );
  1186.  void   xSelectSession( void );
  1187. #endif
  1188.  
  1189. /*---------------------------------------------------------------------------*/
  1190. /* com.c defined functions.                                                  */
  1191. /*---------------------------------------------------------------------------*/
  1192. #ifdef INCL_COM
  1193.  void    AsyncInit( CONNECTION * );
  1194.  void    AsyncSetupComPort(int,int);
  1195.  APIRET  AsyncOpen(int);
  1196.  void    AsyncClose( CONNECTION * );
  1197.  APIRET  AsyncSetDCB( USHORT, USHORT );
  1198.  APIRET  AsyncSetLineCtrl(void);
  1199.  APIRET  AsyncSetBitRate(int);
  1200.  APIRET  AsyncSetClearDTR(int);
  1201.  void    AsyncSend(PVOID,ULONG);
  1202.  void    AsyncRecv(PVOID,ULONG);
  1203.  ULONG   AsyncCheckComError(void);
  1204.  void    AsyncFlushBuffers(void );
  1205.  APIRET  AsyncGetComMsg( char* );
  1206.  APIRET  AsyncPeekRecvBuf(USHORT *);
  1207.  void    AsyncFlushModem( void );
  1208.  int     comdump( ULONG );
  1209.  void    Connect( FILE *, CONNECTION * );
  1210.  int     AsyncPeekComPort( void );
  1211.  LHANDLE GetComHandle( void );
  1212.  void    SetComHandle( LHANDLE );
  1213.  void    SendAT_CommandToModem( char*, BOOL );
  1214.  void    ReadAT_CommandResponse( void );
  1215. #endif
  1216.  
  1217. /*---------------------------------------------------------------------------*/
  1218. /* tx.c defined functions.                                                827*/
  1219. /*---------------------------------------------------------------------------*/
  1220. #ifdef INCL_TX
  1221.  APIRET TxFindExe(char *,char *,UINT );
  1222.  APIRET TxStartUser(char * ,
  1223.                     char * ,
  1224.                     USHORT ,
  1225.                     ULONG *,
  1226.                     ULONG *,
  1227.                     ULONG *,
  1228.                     char * );
  1229.  
  1230.  APIRET TxGoInit( PtraceBuffer *,ULONG *,UINT ** , int* );
  1231.  APIRET TxGoEntry( PtraceBuffer  *,ULONG *,UINT **,int *,ULONG,int );
  1232.  APIRET TxGoStep(PtraceBuffer *,ULONG*,UINT **,int *,ULONG,ULONG,ULONG,int,int);
  1233.  void   TxDefBrk( ULONG );
  1234.  void   TxUndBrk( ULONG );
  1235.  void   TxPutInBrk( ULONG );
  1236.  void   TxPullOutBrk( ULONG);
  1237.  void   TxInsertAllBrk(void);
  1238.  void   TxRemoveAllBrk(void);
  1239.  APIRET APIENTRY TxDosDebug(PtraceBuffer *);
  1240.  ULONG  TxGetThreadInfo(THREADINFO *);
  1241.  void   TxFreezeThread(ULONG tid );
  1242.  void   TxThawThread(ULONG tid );
  1243.  ULONG  TxGetCallStack(STACK_PARMS *,UCHAR **,UINT **,UINT ** );
  1244.  ULONG  TxGetExeOrDllEntryOrExitPt( UINT );
  1245.  APIRET TxNormalQuit( int, UINT, ULONG );
  1246.  APIRET TxSetExecAddr( ULONG );
  1247.  APIRET TxGoFast( PtraceBuffer  *,ULONG *,UINT **,int *,ULONG,int );
  1248.  void   TxDefWps( void *,int );
  1249.  void   TxPutInWps( ULONG * );
  1250.  void   TxPullOutWps( void );
  1251.  UCHAR *TxGetMemoryBlock( ULONG ,int , int * );
  1252.  void  *TxGetMemoryBlocks(void *,int );
  1253.  void   TxSetExceptions( UCHAR *, int );
  1254.  APIRET TxSetExecThread(ULONG *,PtraceBuffer *, UINT );
  1255.  APIRET TxWriteRegs(ULONG *,PtraceBuffer *);
  1256.  APIRET TxGetCoRegs(void * );
  1257.  void   TxTerminateESP( void );
  1258.  void   TxSetEspRunOpts( ESP_RUN_OPTS *);                               /*919*/
  1259.  void   TxSendCtrlBreak( LHANDLE, USHORT );                             /*917*/
  1260.  void   TxStartQueListenThread( void );                                 /*919*/
  1261.  APIRET TxStartEspQue( void );                                          /*919*/
  1262.  void   TxConnectEsp( LHANDLE, USHORT );                                /*919*/
  1263.  void   TxSendKillListen( LHANDLE );
  1264.  void   TxSelectSession( void );
  1265. #endif
  1266.  
  1267. /*---------------------------------------------------------------------------*/
  1268. /* q.c defined functions.                                                 917*/
  1269. /*---------------------------------------------------------------------------*/
  1270.  APIRET  StartQue( char *, void (* _Optlink)(void*) );                  /*917*/
  1271.  void    SendMsgToQue( char *, ULONG,void *, ULONG);                    /*917*/
  1272.  void   *PeekQueMsg( LHANDLE, ULONG );
  1273.  
  1274. /*---------------------------------------------------------------------------*/
  1275. /* File : ESPQ.C                                                          917*/
  1276. /*---------------------------------------------------------------------------*/
  1277. APIRET  StartEspQue( void );                                            /*917*/
  1278. PSZ     GetEspQue( void );                                              /*919*/
  1279. void    ReadEspQue( void *);                                            /*917*/
  1280. void    SendMsgToEspQue( ULONG , void * , ULONG );                      /*919*/
  1281. void    cbrk( void *);                                                  /*917*/
  1282. ULONG  _System EspQueThreadHandler(PEXCEPTIONREPORTRECORD ,             /*917*/
  1283.                                    PEXCEPTIONREGISTRATIONRECORD ,       /*917*/
  1284.                                    PCONTEXTRECORD ,                     /*917*/
  1285.                                    PVOID );                             /*917*/
  1286. ULONG  _System ListenThreadHandler(PEXCEPTIONREPORTRECORD ,             /*917*/
  1287.                                    PEXCEPTIONREGISTRATIONRECORD ,       /*917*/
  1288.                                    PCONTEXTRECORD ,                     /*917*/
  1289.                                    PVOID );                             /*917*/
  1290. ULONG  _System cbrkhandler(PEXCEPTIONREPORTRECORD ,                     /*917*/
  1291.                            PEXCEPTIONREGISTRATIONRECORD ,               /*917*/
  1292.                            PCONTEXTRECORD ,                             /*917*/
  1293.                            PVOID );                                     /*917*/
  1294. void    OpenNamedEspPipe( void *);                                      /*919*/
  1295. void    CloseNamedEspPipe( void );                                      /*919*/
  1296. void    ListenForMsgFromDbg( void * );                                  /*919*/
  1297. void    SendNewProcessToDbg( LHANDLE, USHORT, ULONG, USHORT );
  1298. void    ConnectDbg( LHANDLE, USHORT );
  1299. void    WaitForConnection( void * );
  1300. void    PeekForCtrlBreak( void * );
  1301. void    SetPeekForCtrlBreakFlag( BOOL );
  1302. BOOL    GetPeekForCtrlBreakFlag( void );
  1303. void    SetEspQueName( char * );
  1304. APIRET  StartEspTermQue( void );
  1305. void    ReadEspTermQue( void *);                                        /*917*/
  1306. void    SendMsgToEspTermQue(ULONG , void *, ULONG );                    /*919*/
  1307. BOOL    AllProbesAreDead( void );
  1308. void    ResetAllProbesAreDeadFlag( void );
  1309. void    AddProcessToList( USHORT );
  1310. BOOL    IsProcessInList( USHORT );
  1311.  
  1312. /*---------------------------------------------------------------------------*/
  1313. /* File : DBGQ.C                                                          919*/
  1314. /*---------------------------------------------------------------------------*/
  1315. APIRET  StartDbgQue( void );                                            /*917*/
  1316. void    ReadDbgQue( void *);                                            /*917*/
  1317. void    SendMsgToDbgQue(ULONG , void *, ULONG );                        /*919*/
  1318. APIRET  OpenNamedDbgPipe( void );                                       /*919*/
  1319. void    OpenDbgPipeListenThread( void );                                /*919*/
  1320. void    CloseNamedDbgPipe( void );                                      /*919*/
  1321. void    Create_IO_Sema4( void );                                        /*919*/
  1322. void    Request_IO_Sema4( void );                                       /*919*/
  1323. void    Release_IO_Sema4( void );                                       /*919*/
  1324. void    ListenForMsgFromEsp( void * );                                  /*919*/
  1325. void    PostConnectSema4( HEV *, BOOL );                                /*919*/
  1326. void    SetPollingThreadFlag( int );
  1327. int     GetPollingThreadFlag( void );
  1328. void    PollForMsgFromEsp( void * );
  1329. void    SetDbgQueName( char * );
  1330. APIRET  StartDbgTermQue( void );
  1331. void    ReadDbgTermQue( void *);                                        /*917*/
  1332. void    SendMsgToDbgTermQue(ULONG , void *, ULONG );                    /*919*/
  1333. BOOL    AllDbgsAreDead( void );
  1334. void    ResetAllDbgsAreDeadFlag( void );
  1335.  
  1336. /*---------------------------------------------------------------------------*/
  1337. /* pipe.c defined functions.                                                 */
  1338. /*---------------------------------------------------------------------------*/
  1339. APIRET PipeInit( CONNECTION *, LHANDLE *);
  1340. APIRET CreateNamedPipe( LHANDLE *);
  1341. APIRET OpenNamedPipe( LHANDLE *);
  1342. void   PipeSend( LHANDLE, PVOID, ULONG );
  1343. void   PipeRecv( LHANDLE, PVOID, ULONG );
  1344. void   PipeClose( CONNECTION *, LHANDLE );
  1345.  
  1346. /*---------------------------------------------------------------------------*/
  1347. /* router.c defined functions.                                            919*/
  1348. /*---------------------------------------------------------------------------*/
  1349. BOOL   IsEspRemote( void );
  1350. void   SendConnectionToRouter( CONNECTION * );
  1351. APIRET ConnectInit( int * );
  1352. void   ConnectClose( LHANDLE );
  1353. void   OpenAnotherConnection( LHANDLE * );
  1354. int    ConnectType( void );
  1355. int    SerialParallel( void );
  1356. void   RmtSend( LHANDLE, PVOID, ULONG );
  1357. void   RmtRecv( LHANDLE, PVOID, ULONG );
  1358. void   SetHaltCommunicationsFlag( void );
  1359.  
  1360. /*---------------------------------------------------------------------------*/
  1361. /* netbios.c defined functions.                                           919*/
  1362. /*---------------------------------------------------------------------------*/
  1363. APIRET NetBiosInit( CONNECTION *, LHANDLE *, int * );
  1364. void   BuildLsnName( char *, char *, CONNECTION * );
  1365. APIRET NetBios_Reset( BYTE, BYTE, BYTE, BYTE, int * );
  1366. APIRET NetBios_AddName( char * );
  1367. APIRET NetBios_Call_Answer( int, char *, char *, LHANDLE * );
  1368. void   NetBios_Send( LHANDLE, PVOID, ULONG );
  1369. void   NetBios_Recv( LHANDLE, PVOID, ULONG );
  1370. APIRET NetBiosOriginateSession( CONNECTION *, LHANDLE * );
  1371. void   NetBiosClose( LHANDLE );
  1372.  
  1373. /*---------------------------------------------------------------------------*/
  1374. /* qproc.c defined functions.                                                */
  1375. /*---------------------------------------------------------------------------*/
  1376. void QueryProcesses( void );
  1377.  
  1378. /*---------------------------------------------------------------------------*/
  1379. /* spawn.c defined functions.                                             919*/
  1380. /*---------------------------------------------------------------------------*/
  1381. APIRET SpawnProbe( USHORT *,
  1382.                    ULONG *,
  1383.                    char *,
  1384.                    ULONG,
  1385.                    char *,
  1386.                    ESP_SPAWN_FLAGS);
  1387.  
  1388. APIRET SpawnDbg( USHORT,
  1389.                  USHORT *,
  1390.                  ULONG *,
  1391.                  char *,
  1392.                  ULONG   ,
  1393.                  char * );
  1394.  
  1395. /*---------------------------------------------------------------------------*/
  1396. /* pid.c defined functions.                                                  */
  1397. /*---------------------------------------------------------------------------*/
  1398. void         AddPid( USHORT, ULONG, ULONG, ULONG, char *);
  1399. void         FreeAllPids( void );
  1400. ALLPIDS     *GetPid( USHORT );
  1401. BOOL         IsPidConnected( void );
  1402. ALLPIDS     *GetAllpids     ( void );
  1403. ALLPIDS     *GetPidIndex    ( int  );
  1404. ALLPIDS     *GetPidConnected( void );
  1405. ULONG       *GetShrMem( void );
  1406. void         SetShrMem( ULONG * );
  1407. void         SetShrHeap( ULONG * );
  1408. void         AddDbgPidAndSid( USHORT, USHORT, ULONG );
  1409. int          QueryConnectSema4( void );
  1410. void         SetKillChk4Disconnect( BOOL );
  1411. void         CheckForDisConnect( void * );
  1412. ALLPIDS     *GetEspPid( USHORT );
  1413. void         FreeEspPidHeap( void );
  1414. void         RemovePid( USHORT );
  1415. void         FreeSharedHeap( void );
  1416. void         AddMessage( UCHAR, void *, ULONG );
  1417. void         RemoveMessage( SQE_MESSAGE * );
  1418. void         ReportMessage( void );
  1419. SQE_MESSAGE *GetConnectNotification( void );
  1420. void         Check4ConnectRequest( void * );
  1421. SQE_MESSAGE *IsConnectRequestQueued( USHORT );
  1422. ALLPIDS     *GetDbgPid( USHORT );
  1423. void         SetExecutionFlag( BOOL );
  1424.  
  1425. /*---------------------------------------------------------------------------*/
  1426. /* vb.c  defined functions.                                               919*/
  1427. /*---------------------------------------------------------------------------*/
  1428. void PrintQueMessage( void *,void *);                                   /*919*/
  1429. void PrintDbgQueMessage( void *);
  1430.  
  1431. /*---------------------------------------------------------------------------*/
  1432. /* sema4.c defined functions.                                                */
  1433. /*---------------------------------------------------------------------------*/
  1434. void CreateConnectSema4( USHORT, int );
  1435.  
  1436. void SerialConnect( int,
  1437.                     ULONG,
  1438.                     int,
  1439.                     void  (* QueCaller)( ULONG , void * , ULONG )  );
  1440.  
  1441. void SetConnectSema4   ( HEV *, BOOL );
  1442. void WaitConnectSema4  ( HEV );
  1443. void CloseConnectSema4 ( void );
  1444. void PostConnectSema4  ( HEV *, BOOL );
  1445. void CreateSerialMutex( void );
  1446. void OpenSerialMutex( void );
  1447. void RequestSerialMutex( void );
  1448. void ReleaseSerialMutex( void );
  1449. void CloseSerialMutex( void );
  1450.  
  1451. /*****************************************************************************/
  1452. /* talloc.c                                                                  */
  1453. /*****************************************************************************/
  1454. void *Talloc(UINT size);
  1455. void *Tfree(void *ptr);
  1456.  
  1457. /*---------------------------------------------------------------------------*/
  1458. /* File : Breakpnt.c                                                         */
  1459. /*---------------------------------------------------------------------------*/
  1460. void   SaveBreakpoints( void);
  1461. void   InitBreakpoints( void );
  1462. void   ResetBreakpointFileTime(void);
  1463. void   RestoreBreakpoints( void );
  1464. void   EditBreakpoints( void );
  1465. void   Strip(char *, char, char, char);
  1466. APIRET StripComments( char *, char * );
  1467. char  *FindEndOfComment( char *, char * );
  1468. void   BlankOut( char *, char *);
  1469. void   BlankOutCRLFs( char *, char * );
  1470. int   *BuildBkptLinNumInfo( char *, char *, int * );
  1471. void   SetUsingBreakpointFileFlag(void);
  1472. void   ResetUsingBreakpointFileFlag(void);
  1473. void   KillEditorSession( void );
  1474. char  *GetSD386Brk( void );
  1475. void   FreeSD386Brk( void );
  1476. char  *GetSD386Editor( void );
  1477. void   FreeSD386Editor( void );
  1478. void   MergeBreakpoints(void);
  1479.  
  1480. /*---------------------------------------------------------------------------*/
  1481. /* File : showclas.c                                                         */
  1482. /*---------------------------------------------------------------------------*/
  1483. uint  ShowClass(DFILE *dfp, uint row, uint rows, uint skip);
  1484. UINT  ZapClass (DFILE *dfp, uint row, uint skip );
  1485. void  PutInTabStops( char *cp );
  1486. void  PullOutTabStops( char *cp );
  1487. char *NextTab( char *cp );
  1488. void  InitClassItem(UCHAR *cp, int bufsize);
  1489. BOOL  unmangle( UCHAR *pDeMangledName, UCHAR *pMangledName );
  1490. void  SetViewMemFncs( void );
  1491. BOOL  GetViewMemFncs( void );
  1492. UINT  GetLinesNoMemFncs( UINT mid, Trec *tp );
  1493.  
  1494. /*---------------------------------------------------------------------------*/
  1495. /* File : tcpip.c                                                            */
  1496. /*---------------------------------------------------------------------------*/
  1497. APIRET SockInit( CONNECTION *pConnection,
  1498.                  LHANDLE    *pLsnHandle,
  1499.                  int *p_MoreRcInfo );
  1500. int    SockSocket( void );
  1501. int    SockConnect( int SocketDescriptor, char *ip_name );
  1502. int    SockBind( int SocketDescriptor );
  1503. int    SockListen( int SocketDescriptor );
  1504. int    SockAccept( int SocketDescriptor );
  1505. void   SockSend( int SocketDescriptor, PVOID pBuf, ULONG Len );
  1506. void   SockRecv( int SocketDescriptor, PVOID pBuf, ULONG Len );
  1507. void   SockClose( int SocketDescriptor );
  1508. int    SockGetAnotherSocket( CONNECTION *pConnection );
  1509. int    SockGetDescriptor(void);
  1510. void   SockSetDescriptor(int);
  1511.  
  1512. /*===========================================================================*/
  1513. /*                                                                           */
  1514. /* Everything below is added for MSH support                                 */
  1515. /*                                                                           */
  1516. /*===========================================================================*/
  1517. #ifdef MSH
  1518.  
  1519. /*---------------------------------------------------------------------------*/
  1520. /* File : BROWSEM.C                                                          */
  1521. /*---------------------------------------------------------------------------*/
  1522. int   browsem(int, AFILE *, WINDOWEVENT *);
  1523.  
  1524. /*---------------------------------------------------------------------------*/
  1525. /* File : FINDD.C                                                            */
  1526. /*---------------------------------------------------------------------------*/
  1527. void   FindData(UINT);
  1528. uint   FindScalar(DFILE *,char *,MSHOBJECT *);
  1529. uint   FindConstant(DFILE *,char *,MSHOBJECT *);
  1530. uint   FindHexBytes(DFILE *,char *,MSHOBJECT *);
  1531.  
  1532. /*---------------------------------------------------------------------------*/
  1533. /* File : FINDD2.C                                                           */
  1534. /*---------------------------------------------------------------------------*/
  1535. uint    FindStruct(DFILE *,char *,MSHOBJECT *);
  1536. uint    FindArray(DFILE *,char *,MSHOBJECT *);
  1537.  
  1538. /*---------------------------------------------------------------------------*/
  1539. /* File : MSH.C                                                              */
  1540. /*---------------------------------------------------------------------------*/
  1541. UCHAR *MshAppData(UINT, UINT*, UINT, UINT*, UINT, MSHOBJECT *);                                /*101*/
  1542. int    MshSD386CommandProcessor(UINT, void *);
  1543. int    MshParseExpr(UCHAR *, UCHAR *, UINT, UINT, UINT, MSHOBJECT *);
  1544. void   MshMonitor(int);
  1545. int    SD386Log(int icode, char *string);
  1546. int   _System mshgetenv(char *);
  1547. void   mshsessioninit(void);
  1548. int   _Optlink writemshsd386(char *);
  1549.  
  1550. /* int   _System MshPutObject(MSHOBJECT *mshObject, int, int, ...); */
  1551. void   mshInit(void);
  1552. void   APIENTRY MSHExit(void);
  1553.  
  1554. char  *GetMSHHome( void );
  1555. void   FreeMSHHome( void );
  1556.  
  1557. /*---------------------------------------------------------------------------*/
  1558. /* File : cpydata.c                                                          */
  1559. /*---------------------------------------------------------------------------*/
  1560. int  mshsd386command(char *);
  1561.  
  1562. /*****************************************************************************/
  1563. /* MSHCALC entry points.                                                     */
  1564. /*****************************************************************************/
  1565. typedef int  (* _System MSHPUTOBJECT )(MSHOBJECT *mshObject, int, int, ...);
  1566. typedef int  (* _System MSHOBJECTSIZE)(MSHOBJECT *mshObject);
  1567. typedef int  (* _System MSHOBJECTDATASIZE)(MSHOBJECT *);
  1568. typedef int  (* _System MSHPUTSIMPLEOBJECT)(MSHOBJECT *, int, int, ...);
  1569. typedef void (* _System MSHINITOBJECT)(MSHOBJECT *) ;
  1570. typedef int  (* _System MSHGET_DIRECT)(char *, int *, int *, int *, char *);
  1571. typedef int  (* _System MSHPUT_DIRECT)(char *, int, int, int, char *);
  1572. typedef int  (* _System MSHXLDBCOMMAND)(char *, int, int );
  1573. typedef int  (* _System MSHXLDBINIT)(int,
  1574.                                      char **,
  1575.                                      char **,
  1576.                                      int (*importfns[])(void));
  1577. typedef int  (* _System MSHOS2INIT)(void);
  1578. typedef int  (* _System KILL)(int, int);
  1579. typedef Shmcom* SHMCOM;
  1580.  
  1581. /*****************************************************************************/
  1582. /* REXXMSH entry point.                                                      */
  1583. /*****************************************************************************/
  1584. typedef int (* _Optlink WRITE_MSH_REXX)(char *);
  1585. typedef int (* _System  MSH_LOAD_FUNCS)(CHAR *name, ULONG numargs, RXSTRING args[],
  1586.                            CHAR *queuename, RXSTRING *retstr);
  1587.  
  1588. /*****************************************************************************/
  1589. /* REXX entry point.                                                         */
  1590. /*****************************************************************************/
  1591. typedef LONG (* _System REXX_START)(LONG ,
  1592.                                     PRXSTRING,
  1593.                                     PSZ,
  1594.                                     PRXSTRING,
  1595.                                     PSZ,
  1596.                                     LONG ,
  1597.                                     PRXSYSEXIT,
  1598.                                     PSHORT,
  1599.                                     PRXSTRING );
  1600.  
  1601. /*****************************************************************************/
  1602. /* talloc.c                                                                  */
  1603. /*****************************************************************************/
  1604. void *T2alloc(UINT size, int chain);
  1605. char *MyMalloc(int, int);
  1606. char *MyFree(char *);
  1607. char *FreeChain(int);
  1608.  
  1609. /*---------------------------------------------------------------------------*/
  1610. /* File : Action.c  this function is added to support MSH                    */
  1611. /*---------------------------------------------------------------------------*/
  1612. WINDOWEVENT *BrowseMshFile(AFILE *fp);
  1613.  
  1614. /*---------------------------------------------------------------------------*/
  1615. /* cpydata.c defined functions.                                              */
  1616. /*---------------------------------------------------------------------------*/
  1617.  void   CopyDataItem(CHAR *,COPYDATA **,UINT,UINT,USHORT,UINT,UINT,MSHOBJECT*);
  1618.  void   CpyChar( COPYDATA **, ULONG , UINT, USHORT, UINT,MSHOBJECT*);
  1619.  void   CpyShort( COPYDATA **, ULONG , UINT, USHORT, UINT,MSHOBJECT*);
  1620.  void   CpyLong( COPYDATA **, ULONG , UINT, USHORT, UINT,MSHOBJECT*);
  1621.  void   CpyFloat( UINT, COPYDATA **, ULONG , UINT, USHORT, UINT,MSHOBJECT*);
  1622.  USHORT CpyPtr( COPYDATA **, ULONG*, UINT, USHORT, UINT,MSHOBJECT*);
  1623.  void   CpyBytes( COPYDATA **, ULONG , UINT , UINT ,MSHOBJECT*);
  1624.  void   CpyString( COPYDATA **, char *,ULONG, UINT ,MSHOBJECT*);
  1625.  USHORT CpyEnums( Trec *,COPYDATA **, ULONG , UINT , USHORT, UINT ,MSHOBJECT*);
  1626.  void   CpyBitField(Trec *, COPYDATA **, ULONG , UINT , USHORT ,UINT ,MSHOBJECT*);
  1627.  
  1628. /*---------------------------------------------------------------------------*/
  1629. /* File : HELP.C                                                             */
  1630. /*---------------------------------------------------------------------------*/
  1631. void   FmtErr(UCHAR *msg);
  1632.  
  1633. #endif
  1634.