Changeset 5815 for trunk/src/kernel32/mmap.cpp
- Timestamp:
- May 28, 2001, 1:26:50 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/mmap.cpp
r5027 r5815 1 /* $Id: mmap.cpp,v 1.5 0 2001-01-25 20:18:05 sandervlExp $ */1 /* $Id: mmap.cpp,v 1.51 2001-05-28 11:26:06 phaller Exp $ */ 2 2 3 3 /* … … 709 709 //****************************************************************************** 710 710 //****************************************************************************** 711 Win32MemMap *Win32MemMapView::findMapByView(ULONG address, ULONG *offset, 711 Win32MemMap *Win32MemMapView::findMapByView(ULONG address, 712 ULONG *offset, 712 713 ULONG accessType, 713 714 Win32MemMapView **pView) … … 715 716 globalviewMutex.enter(); 716 717 Win32MemMapView *view = mapviews; 718 ULONG ulViewAddr; 717 719 718 720 *offset = 0; 719 721 720 if(view != NULL) { 721 while(view && (ULONG)view->getViewAddr() <= address) { 722 if((ULONG)view->getViewAddr() <= address && 723 (ULONG)view->getViewAddr() + view->getSize() > address && 724 view->getAccessFlags() >= accessType) 722 if(view != NULL) 723 { 724 do 725 { 726 ulViewAddr = (ULONG)view->getViewAddr(); 727 728 // if ulViewAddr is > address, we've exhausted 729 // the sorted list already and can abort search. 730 if(ulViewAddr <= address) 731 { 732 if(ulViewAddr + view->getSize() > address && 733 view->getAccessFlags() >= accessType) 725 734 { 726 *offset = view->getOffset() + (address - (ULONG)view->getViewAddr()); 727 goto success; 728 } 735 *offset = view->getOffset() + (address - ulViewAddr); 736 goto success; 737 } 738 739 // Not found yet, continue search with next map 729 740 view = view->next; 730 } 741 } 742 else 743 { 744 // list is exhausted, abort loop 745 view = NULL; 746 } 747 } 748 while(view); 749 731 750 //failure if we get here 732 751 view = NULL; 733 752 } 753 734 754 success: 755 #ifdef DEBUG 735 756 if(view && !view->getParentMap()->isImageMap()) 736 dprintf(("findMapByView %x %x -> %x off %x", address, accessType, view->getViewAddr(), *offset)); 757 dprintf(("findMapByView %x %x -> %x off %x", 758 address, 759 accessType, 760 view->getViewAddr(), 761 *offset)); 762 #endif 737 763 738 764 globalviewMutex.leave(); 739 if(pView) *pView = view; 765 766 if(pView) 767 *pView = view; 768 740 769 return (view) ? view->getParentMap() : NULL; 741 770 }
Note:
See TracChangeset
for help on using the changeset viewer.