DWORD SymGetOptions(void);
函数返回当前的符号引擎选项,返回的是一个DWORD类型的值,可以使用下列宏进行解析:
#define SYMOPT_CASE_INSENSITIVE 0x00000001
#define SYMOPT_UNDNAME 0x00000002
#define SYMOPT_DEFERRED_LOADS 0x00000004
#define SYMOPT_NO_CPP 0x00000008
#define SYMOPT_LOAD_LINES 0x00000010
#define SYMOPT_OMAP_FIND_NEAREST 0x00000020
#define SYMOPT_LOAD_ANYTHING 0x00000040
#define SYMOPT_IGNORE_CVREC 0x00000080
#define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100
#define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200
#define SYMOPT_EXACT_SYMBOLS 0x00000400
#define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS 0x00000800
#define SYMOPT_IGNORE_NT_SYMPATH 0x00001000
#define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000
#define SYMOPT_PUBLICS_ONLY 0x00004000
#define SYMOPT_NO_PUBLICS 0x00008000
#define SYMOPT_AUTO_PUBLICS 0x00010000
#define SYMOPT_NO_IMAGE_SEARCH 0x00020000
#define SYMOPT_SECURE 0x00040000
#define SYMOPT_NO_PROMPTS 0x00080000
#define SYMOPT_OVERWRITE 0x00100000
#define SYMOPT_IGNORE_IMAGEDIR 0x00200000
#define SYMOPT_FLAT_DIRECTORY 0x00400000
#define SYMOPT_FAVOR_COMPRESSED 0x00800000
#define SYMOPT_ALLOW_ZERO_ADDRESS 0x01000000
#define SYMOPT_DISABLE_SYMSRV_AUTODETECT 0x02000000
#define SYMOPT_READONLY_CACHE 0x04000000
#define SYMOPT_SYMPATH_LAST 0x08000000
#define SYMOPT_DISABLE_FAST_SYMBOLS 0x10000000
#define SYMOPT_DISABLE_SYMSRV_TIMEOUT 0x20000000
#define SYMOPT_DISABLE_SRVSTAR_ON_STARTUP 0x40000000
#define SYMOPT_DEBUG 0x80000000
例如,如果希望知道 SymLoadModuleEx 函数是否会自动加载调试符号,可以使用以下代码:
DWORD options = SymGetOptions();
if (options & SYMOPT_DEFERRED_LOADS) {
// SYMOPT_DEFERRED_LOADS 选项已设置
printf("SYMOPT_DEFERRED_LOADS is enabled.\n");
} else {
// SYMOPT_DEFERRED_LOADS 选项未设置
printf("SYMOPT_DEFERRED_LOADS is not enabled.\n");
}
请注意,上述的宏定义是用于解析 SymGetOptions 返回值的一部分选项。您可以根据需要组合使用这些宏进行更详细的解析。
转载请注明出处:http://www.zyzy.cn/article/detail/26330/Win32 API/Dbghelp.h/SymGetOptions