home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sdktools / image / drwatson / symbols.c < prev    next >
C/C++ Source or Header  |  1995-07-20  |  1KB  |  64 lines

  1. /*++
  2.  
  3. Copyright (c) 1993  Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     symbols.c
  8.  
  9. Abstract:
  10.  
  11.     This file contains all support for the symbol table.
  12.  
  13. Author:
  14.  
  15.     Wesley Witt (wesw) 1-May-1993
  16.  
  17. Environment:
  18.  
  19.     User Mode
  20.  
  21. --*/
  22.  
  23. #include <windows.h>
  24. #include <stdlib.h>
  25. #include <stdio.h>
  26. #include <string.h>
  27. #include <imagehlp.h>
  28.  
  29. #include "drwatson.h"
  30. #include "proto.h"
  31. #include "messages.h"
  32.  
  33.  
  34.  
  35. BOOL
  36. SymbolEnumFunc(
  37.     LPSTR   SymbolName,
  38.     ULONG   Address,
  39.     ULONG   Size,
  40.     PVOID   Cxt
  41.     )
  42. {
  43.     lprintfs( "%08x %08x   %s\r\n", Address, Size, SymbolName );
  44.     return TRUE;
  45. }
  46.  
  47.  
  48. VOID
  49. DumpSymbols(
  50.     PDEBUGPACKET dp
  51.     )
  52. {
  53.     IMAGEHLP_MODULE   mi;
  54.  
  55.  
  56.     if (SymGetModuleInfo( dp->hProcess, 0, &mi )) {
  57.         lprintf( MSG_SYMBOL_TABLE );
  58.         do {
  59.             lprintfs( "%s\r\n\r\n", mi.ImageName );
  60.             SymEnumerateSymbols( dp->hProcess, mi.BaseOfImage, SymbolEnumFunc, NULL );
  61.         } while( SymGetModuleInfo( dp->hProcess, (DWORD)-1, &mi ));
  62.     }
  63. }
  64.