SYMBOLS.C
资源名称:MSDN_VC98.zip [点击查看]
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:1k
源码类别:
Windows编程
开发平台:
Visual C++
- /*++
- Copyright (c) 1993 Microsoft Corporation
- Module Name:
- symbols.c
- Abstract:
- This file contains all support for the symbol table.
- Author:
- Wesley Witt (wesw) 1-May-1993
- Environment:
- User Mode
- --*/
- #include <windows.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <imagehlp.h>
- #include "drwatson.h"
- #include "proto.h"
- #include "messages.h"
- BOOL
- SymbolEnumFunc(
- LPSTR SymbolName,
- ULONG Address,
- ULONG Size,
- PVOID Cxt
- )
- {
- lprintfs( "%08x %08x %srn", Address, Size, SymbolName );
- return TRUE;
- }
- VOID
- DumpSymbols(
- PDEBUGPACKET dp
- )
- {
- IMAGEHLP_MODULE mi;
- if (SymGetModuleInfo( dp->hProcess, 0, &mi )) {
- lprintf( MSG_SYMBOL_TABLE );
- do {
- lprintfs( "%srnrn", mi.ImageName );
- SymEnumerateSymbols( dp->hProcess, mi.BaseOfImage, SymbolEnumFunc, NULL );
- } while( SymGetModuleInfo( dp->hProcess, (DWORD)-1, &mi ));
- }
- }