c++ - 是否可以根据反汇编推断source中哪一行有问题?

标签 c++ windows visual-studio disassembly dia-sdk

017D0B5F 调用 eax 时存在问题:

017D0B56  mov         esi,esp 
017D0B58  mov         edx,dword ptr [ebp-20h] 
017D0B5B  push        edx  
017D0B5C  mov         eax,dword ptr [ecx+8] 
017D0B5F  call        eax  
017D0B61  cmp         esi,esp 
017D0B63  call        @ILT+2525(__RTC_CheckEsp) (17C49E2h) 
017D0B68  cmp         dword ptr [ebp-2Ch],0 
017D0B6C  je          CSourceStream::DoBufferProcessingLoop+10Ah (17D0B8Ah) 
017D0B6E  mov         eax,dword ptr [ebp-2Ch] 
017D0B71  push        eax  
017D0B72  push        offset string "Deliver() returned %08x; stoppin"... (17F7278h) 

这是相应的来源:

 // Virtual function user will override.
 hr = FillBuffer(pSample);

 if (hr == S_OK) {
 hr = Deliver(pSample);
            pSample->Release();

            // downstream filter returns S_FALSE if it wants us to
            // stop or an error if it's reporting an error.
            if(hr != S_OK)
            {
              DbgLog((LOG_TRACE, 2, TEXT("Deliver() returned %08x; stopping"), hr));
              return S_OK;
            }

是否可以根据反汇编推断source中哪一行有问题?

更新

__RTC_CheckEsp 是什么意思?

更新 2

在调试器中重现

alt text

更新 3

alt text

最佳答案

看起来是 pSample->Release() 调用 - 你得到了什么错误?

017D0B56  mov         esi,esp 
017D0B58  mov         edx,dword ptr [ebp-20h]     // get the pSample this pointer
017D0B5B  push        edx                         // push it
017D0B5C  mov         eax,dword ptr [ecx+8]       // move pSample to eax
017D0B5F  call        eax                         // call it
017D0B61  cmp         esi,esp                     // maybe a stack/heap check?
017D0B63  call        @ILT+2525(__RTC_CheckEsp) (17C49E2h) 
017D0B68  cmp         dword ptr [ebp-2Ch],0       // if hr!=S_OK
017D0B6C  je          CSourceStream::DoBufferProcessingLoop+10Ah (17D0B8Ah) 
017D0B6E  mov         eax,dword ptr [ebp-2Ch] 
017D0B71  push        eax                         // get ready to call DbgLog
017D0B72  push        offset string "Deliver() returned %08x; stoppin"... (17F7278h)

关于c++ - 是否可以根据反汇编推断source中哪一行有问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3898905/

相关文章:

c++ - 计算给定数组的子序列数,使得它们的总和小于或等于给定数?

c++嵌套策略模式,纯虚拟错误

c++ - 无法识别 main() 函数

windows - 如何在 C/C++ 中以编程方式在外部 USB HD 上启用 "Better Performance"

c++ - Windows 上的 Boost::Asio 不能异步工作

c++ - 调试器如何只看到值而不是变量的内存地址

c++ - USphereComponent 和 Overlap 事件

database - 在 Visual Studio 中定义多个外键

c# - 为什么 Visual Studio 2010 的 Crystal Reports 不能在 Windows XP 上运行?

c - 读取另一个进程的环境变量