Changeset 104841 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jun 5, 2024 1:00:55 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp
r100357 r104841 258 258 DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, const char *pszTag) 259 259 { 260 AssertMsgReturn(cb <= _1G, ("%#x\n", cb), VERR_OUT_OF_RANGE); /* for safe size_t -> ULONG */261 260 RT_NOREF1(fExecutable); 262 261 … … 316 315 } 317 316 } 317 318 /* 319 * There are serveral limiting factors here. First there the ULONG length 320 * parameter in the IoAllocateMdl call that means the absolute maximum is 321 * 4GiB - PAGE_SIZE. That API is documented to limit the max length 322 * differently for the windows versions: 323 * - Pre-vista: (65535 - sizeof(MLD)/sizeof(ULONG_PTR)) * PAGE_SIZE 324 * - Vista & Server 2008: 2GiB - PAGE_SIZE. 325 * - Windows 7 & Server 2008 R2 and higher: 4GiB - PAGE_SIZE. 326 * 327 * Before that we've got the limitations of the pool code and available 328 * kernel mapping space (32-bit). 329 */ 330 #if ARCH_BITS == 32 331 AssertMsgReturn(cb < _512M, ("%#x\n", cb), VERR_OUT_OF_RANGE); 332 #else 333 AssertMsgReturn(cb < _4G, ("%#x\n", cb), VERR_OUT_OF_RANGE); 334 #endif 318 335 319 336 /*
Note:
See TracChangeset
for help on using the changeset viewer.