- 時間撮記:
- 2011-8-26 下午12:58:47 (13 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/common/ldr/ldrkStuff.cpp
r38531 r38547 629 629 630 630 631 /** @copydoc RTLDROPS::pfnEnumSegments. */ 632 static DECLCALLBACK(int) rtkldr_EnumSegments(PRTLDRMODINTERNAL pMod, PFNRTLDRENUMSEGS pfnCallback, void *pvUser) 633 { 634 PRTLDRMODKLDR pThis = (PRTLDRMODKLDR)pMod; 635 uint32_t const cSegments = pThis->pMod->cSegments; 636 PCKLDRSEG paSegments = &pThis->pMod->aSegments[0]; 637 638 for (uint32_t iSeg = 0; iSeg < cSegments; iSeg++) 639 { 640 RTLDRSEG Seg; 641 642 Seg.pchName = paSegments[iSeg].pchName; 643 Seg.cchName = paSegments[iSeg].cchName; 644 Seg.SelFlat = paSegments[iSeg].SelFlat; 645 Seg.Sel16bit = paSegments[iSeg].Sel16bit; 646 Seg.fFlags = paSegments[iSeg].fFlags; 647 AssertCompile(KLDRSEG_FLAG_16BIT == RTLDRSEG_FLAG_16BIT ); 648 AssertCompile(KLDRSEG_FLAG_OS2_ALIAS16 == RTLDRSEG_FLAG_OS2_ALIAS16); 649 AssertCompile(KLDRSEG_FLAG_OS2_CONFORM == RTLDRSEG_FLAG_OS2_CONFORM); 650 AssertCompile(KLDRSEG_FLAG_OS2_IOPL == RTLDRSEG_FLAG_OS2_IOPL ); 651 652 switch (paSegments[iSeg].enmProt) 653 { 654 default: 655 AssertMsgFailed(("%d\n", paSegments[iSeg].enmProt)); 656 case KPROT_NOACCESS: 657 Seg.fProt = 0; 658 break; 659 660 case KPROT_READONLY: Seg.fProt = RTMEM_PROT_READ; break; 661 case KPROT_READWRITE: Seg.fProt = RTMEM_PROT_READ | RTMEM_PROT_WRITE; break; 662 case KPROT_WRITECOPY: Seg.fProt = RTMEM_PROT_WRITE; break; 663 case KPROT_EXECUTE: Seg.fProt = RTMEM_PROT_EXEC; break; 664 case KPROT_EXECUTE_READ: Seg.fProt = RTMEM_PROT_EXEC | RTMEM_PROT_READ; break; 665 case KPROT_EXECUTE_READWRITE: Seg.fProt = RTMEM_PROT_EXEC | RTMEM_PROT_READ | RTMEM_PROT_WRITE; break; 666 case KPROT_EXECUTE_WRITECOPY: Seg.fProt = RTMEM_PROT_EXEC | RTMEM_PROT_WRITE; break; 667 } 668 Seg.cb = paSegments[iSeg].cb; 669 Seg.Alignment = paSegments[iSeg].Alignment; 670 Seg.LinkAddress = paSegments[iSeg].LinkAddress; 671 Seg.offFile = paSegments[iSeg].offFile; 672 Seg.cbFile = paSegments[iSeg].cbFile; 673 Seg.RVA = paSegments[iSeg].RVA; 674 Seg.cbMapped = paSegments[iSeg].cbMapped; 675 676 int rc = pfnCallback(pMod, &Seg, pvUser); 677 if (rc != VINF_SUCCESS) 678 return rc; 679 } 680 681 return VINF_SUCCESS; 682 } 683 684 631 685 /** 632 686 * Operations for a kLdr module. … … 645 699 rtkldr_GetSymbolEx, 646 700 rtkldr_EnumDbgInfo, 701 rtkldr_EnumSegments, 647 702 42 648 703 };
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器