Changeset 65413 in vbox for trunk/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp
- Timestamp:
- Jan 24, 2017 10:26:59 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp
r62477 r65413 36 36 #include <iprt/err.h> 37 37 #include "r0drv/alloc-r0drv.h" 38 #include "internal-r0drv-nt.h" 38 39 39 40 … … 43 44 DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFlags, PRTMEMHDR *ppHdr) 44 45 { 45 if (fFlags & RTMEMHDR_FLAG_ANY_CTX) 46 return VERR_NOT_SUPPORTED; 47 48 PRTMEMHDR pHdr = (PRTMEMHDR)ExAllocatePoolWithTag(NonPagedPool, cb + sizeof(*pHdr), IPRT_NT_POOL_TAG); 49 if (RT_UNLIKELY(!pHdr)) 46 if (!(fFlags & RTMEMHDR_FLAG_ANY_CTX)) 47 { 48 #if 0 /* This allegedly makes the driver verifier happier... */ 49 POOL_TYPE enmPoolType = NonPagedPool; 50 if (!(fFlags & RTMEMHDR_FLAG_EXEC) && g_uRtNtVersion >= RTNT_MAKE_VERSION(8,0)) 51 enmPoolType = NonPagedPoolNx; 52 PRTMEMHDR pHdr = (PRTMEMHDR)ExAllocatePoolWithTag(enmPoolType, cb + sizeof(*pHdr), IPRT_NT_POOL_TAG); 53 #else 54 PRTMEMHDR pHdr = (PRTMEMHDR)ExAllocatePoolWithTag(NonPagedPool, cb + sizeof(*pHdr), IPRT_NT_POOL_TAG); 55 #endif 56 if (pHdr) 57 { 58 pHdr->u32Magic = RTMEMHDR_MAGIC; 59 pHdr->fFlags = fFlags; 60 pHdr->cb = (uint32_t)cb; Assert(pHdr->cb == cb); 61 pHdr->cbReq = (uint32_t)cb; 62 *ppHdr = pHdr; 63 return VINF_SUCCESS; 64 } 50 65 return VERR_NO_MEMORY; 51 52 pHdr->u32Magic = RTMEMHDR_MAGIC; 53 pHdr->fFlags = fFlags; 54 pHdr->cb = (uint32_t)cb; Assert(pHdr->cb == cb); 55 pHdr->cbReq = (uint32_t)cb; 56 *ppHdr = pHdr; 57 return VINF_SUCCESS; 66 } 67 return VERR_NOT_SUPPORTED; 58 68 } 59 69
Note:
See TracChangeset
for help on using the changeset viewer.