Changeset 29472 in vbox
- Timestamp:
- May 14, 2010 1:48:15 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServicePageSharing.cpp
r29424 r29472 129 129 do 130 130 { 131 MEMORY_BASIC_INFORMATION MemInfo [16];132 133 SIZE_T ret = VirtualQueryEx(hProcess, pBaseAddress, &MemInfo [0], sizeof(MemInfo));131 MEMORY_BASIC_INFORMATION MemInfo; 132 133 SIZE_T ret = VirtualQueryEx(hProcess, pBaseAddress, &MemInfo, sizeof(MemInfo)); 134 134 Assert(ret); 135 135 if (!ret) … … 139 139 } 140 140 141 unsigned cMemInfoBlocks = ret / sizeof(MemInfo[0]); 142 143 for (unsigned i = 0; i < cMemInfoBlocks; i++) 144 { 145 if ( MemInfo[i].State == MEM_COMMIT 146 && MemInfo[i].Type == MEM_IMAGE) 141 if ( MemInfo.State == MEM_COMMIT 142 && MemInfo.Type == MEM_IMAGE) 143 { 144 switch (MemInfo.Protect) 147 145 { 148 switch (MemInfo[i].Protect) 149 { 150 case PAGE_EXECUTE: 151 case PAGE_EXECUTE_READ: 152 case PAGE_READONLY: 153 aRegions[idxRegion].GCRegionAddr = (RTGCPTR64)MemInfo[i].BaseAddress; 154 aRegions[idxRegion].cbRegion = MemInfo[i].RegionSize; 155 idxRegion++; 156 break; 157 158 default: 159 break; /* ignore */ 160 } 146 case PAGE_EXECUTE: 147 case PAGE_EXECUTE_READ: 148 case PAGE_READONLY: 149 aRegions[idxRegion].GCRegionAddr = (RTGCPTR64)MemInfo.BaseAddress; 150 aRegions[idxRegion].cbRegion = MemInfo.RegionSize; 151 idxRegion++; 152 break; 153 154 default: 155 break; /* ignore */ 161 156 } 162 163 pBaseAddress = (BYTE *)MemInfo[i].BaseAddress + MemInfo[i].RegionSize; 164 if (dwModuleSize > MemInfo[i].RegionSize) 165 { 166 dwModuleSize -= MemInfo[i].RegionSize; 167 } 168 else 169 { 170 dwModuleSize = 0; 171 break; 172 } 173 174 if (idxRegion >= RT_ELEMENTS(aRegions)) 175 break; /* out of room */ 176 } 157 } 158 159 pBaseAddress = (BYTE *)MemInfo.BaseAddress + MemInfo.RegionSize; 160 if (dwModuleSize > MemInfo.RegionSize) 161 { 162 dwModuleSize -= MemInfo.RegionSize; 163 } 164 else 165 { 166 dwModuleSize = 0; 167 break; 168 } 169 177 170 if (idxRegion >= RT_ELEMENTS(aRegions)) 178 171 break; /* out of room */
Note:
See TracChangeset
for help on using the changeset viewer.