Ignore:
Timestamp:
Feb 5, 2011, 11:43:01 PM (13 years ago)
Author:
イグトランス (egtra)
Message:

PSAPIを使用している箇所について、Toolhelp32と選択するよう修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/CDebugThreadInfo.cpp

    r741 r798  
    44#include "DebugSection.h"
    55
     6#include <ProcessAndModule.h>
    67
    78//デバッグ用
     
    1011
    1112extern HANDLE hDebugProcess;
     13extern DWORD processIdDebug;
    1214extern DebugSectionCollection debugSectionCollection;
    1315
     
    6769
    6870    //マッピングされているモジュールのイメージベースを取得
    69     HMODULE array_hModule[1024];
    70     DWORD cbReturned;
    71     if(!EnumProcessModules( hDebugProcess, array_hModule, sizeof(HMODULE)*1024, &cbReturned )) return 0;
     71    //HMODULE array_hModule[1024];
     72    //DWORD cbReturned;
     73    //if(!EnumProcessModules( hDebugProcess, array_hModule, sizeof(HMODULE)*1024, &cbReturned )) return 0;
     74    auto modules = ActiveBasic::Common::GetModules(processIdDebug);
    7275
    73     int i;
    7476    HMODULE hTargetModule=0;
    75     for(i=0;i<(int)(cbReturned/sizeof(HMODULE));i++){
    76         if((LONG_PTR)array_hModule[i]<=(LONG_PTR)EIP_RIP(Context)){
    77             if(hTargetModule<array_hModule[i]) hTargetModule=array_hModule[i];
     77    for (std::size_t i = 0; i < modules.size(); ++i)
     78    {
     79        if ((LONG_PTR)modules[i]<=(LONG_PTR)EIP_RIP(Context))
     80        {
     81            if (hTargetModule<modules[i])
     82            {
     83                hTargetModule=modules[i];
     84            }
    7885        }
    7986    }
     
    8188    extern DWORD ImageBase;
    8289    if((HMODULE)(ULONG_PTR)ImageBase!=hTargetModule){
    83         for(i=0;i<debugSectionCollection.debugSections.size();i++){
     90        for(std::size_t i=0;i<debugSectionCollection.debugSections.size();i++){
    8491            if((HMODULE)(ULONG_PTR)debugSectionCollection.debugSections[i]->dwImageBase==hTargetModule){
    8592                debugSectionCollection.choice(i);
Note: See TracChangeset for help on using the changeset viewer.