SymInitialize失败,错误2147483661

SymInitialize失败,错误2147483661,第1张

概述SymInitialize失败错误2147483661

任何想法为什么发生这种情况 该方法完美地工作在当前进程和失败的远程进程运行在同一本地计算机上,对于我来说垃圾错误代码为2147483661(0x80000000D),因为这个特定的错误代码没有任何提示,或者我错过了什么? 。 另外,我觉得; 因为SymInitialize本身失败, SymFromAddr也是SymFromAddr 。 我对么?

有问题的过程以pipe理员身份运行,并具有SeDeBUG和SeSecurity权限。

bool DbgHelpWrapper::MatchTargetSymbol( IntPtr processHandle,int procID,int threadID ) { DWORD DWStartAddress; DWORD DWInitializeError; DWORD DWThreadID = static_cast<DWORD>(threadID); DWORD DWProcessID = static_cast<DWORD>(procID); HANDLE hRemoteProcess = OpenProcess( PROCESS_ALL_ACCESS,FALSE,DWProcessID ); if (GetThreadStartAddress( processHandle,DWProcessID,DWThreadID,&DWStartAddress )) { DWInitializeError = ERROR_SUCCESS; } else { DWInitializeError = Marshal::GetLastWin32Error(); System::Console::Writeline( String::Format("GetThreadStartAddress Failed: {0}",DWInitializeError )); } try { DWORD DWSymSetoptStatus = SymSetoptions(SYMOPT_DEFERRED_LOADS | SYMOPT_UNDname | SYMOPT_LOAD_lines); DWORD DWSymInitStatus = ERROR_SUCCESS; if (DWSymInitStatus = SymInitialize(hRemoteProcess,NulL,TRUE)) { DWInitializeError = ERROR_SUCCESS; } else { DWInitializeError = Marshal::GetLastWin32Error(); System::Console::Writeline( String::Format("SymInitialize Failed: {0} error: {1}",DWSymInitStatus,DWInitializeError )); return false; } const int kMaxnameLength = 256; ulONG64 buffer[(sizeof(SYMBol_INFO) + kMaxnameLength * sizeof(wchar_t) + sizeof(ulONG64) - 1) / sizeof(ulONG64)]; memset(buffer,sizeof(buffer)); // Initialize symbol information retrIEval structures. DWORD64 sym_displacement = 0; PSYMBol_INFO symbol = reinterpret_cast<PSYMBol_INFO>(&buffer[0]); symbol->SizeOfStruct = sizeof(SYMBol_INFO); symbol->MaxnameLen = kMaxnameLength - 1; if( SymFromAddr(hRemoteProcess,(DWORD64)DWStartAddress,&sym_displacement,symbol )) { System::String^ name = gcnew System::String( symbol->name ); System::Console::Writeline( String::Format("Found thread with Modulename: {0}",name )); if( name->Contains( this->symbolname )) { return true; } } else { DWInitializeError = Marshal::GetLastWin32Error(); System::Console::Writeline( String::Format("SymFromAddr Failed: {0}",DWInitializeError )); } } finally { CloseHandle(hRemoteProcess); } return false; }

使用CreateProcess函数

为什么calloc无法在具有4GB内存的系统上分配1GB?

batch file – 注册所有的Dll的

行数和exception结果

在windows和linux下开发的C ++程序的区别

在添加request_mem_region之后,我的驱动程序每次首次访问都会失败,并显示“busy”消息

Qt:打印原始文本

从windows服务启动浏览器

什么是最快的半任意精度math库?

windows可执行文件的映射文件可以写入吗?

另一个原因,虽然可能不是在这种情况下,可能是这个过程还没有完全开始。 在我的调试器代码中,WaitForDeBUGEvent返回一个CREATE_PROCESS_DEBUG_EVENT事件代码后立即调用SymInitialize。 这给了0x80000000D。 稍后调用(就在我需要堆栈走路之前)成功了。

微软的结果代码通常用十六进制表示。 在这种情况下,你会为​​Google“SymInitialize error 8000000D”:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms681351%28v=vs.85%29.aspx

我错误地提出了任何错误代码“8000000D”(除了这个 ,但MSDN链接听起来很有趣:

传递给SymInitialize的句柄必须与传递给进程调用的所有其他符号处理函数的值相同。 这是函数用来识别调用者并定位正确的符号信息的句柄。 <=听起来你正在做这个…

A process that calls SymInitialize should not call it again unless it calls SymCleanup first. <= What about this? All DbgHelp functions,such as this one,are single threaded. Therefore,calls from more than one thread to this function will likely result in unexpected behavior or memory corruption. To avoID this,call SymInitialize only when your process starts and SymCleanup only when your process ends. It is not necessary for each thread in the process to call these functions. <= Or this

问:您不是从多个线程调用SymInitialize(),是吗?

如果您尝试调用SymInitialize,则会出现错误2147483661,其中进程ID属于64位进程,但您自己的进程是32位进程。

总结

以上是内存溢出为你收集整理的SymInitialize失败,错误2147483661全部内容,希望文章能够帮你解决SymInitialize失败,错误2147483661所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1154892.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存