Changeset 65413 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jan 24, 2017 10:26:59 AM (8 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/nt
- Files:
-
- 4 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 -
trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp
r64281 r65413 104 104 uint32_t g_offrtNtPbDpcQueueDepth; 105 105 106 /** The major version number. */ 107 uint8_t g_uRtNtMajorVer; 108 /** The minor version number. */ 109 uint8_t g_uRtNtMinorVer; 110 /** The build number. */ 111 uint32_t g_uRtNtBuildNo; 112 106 113 107 114 /** … … 306 313 RTNTSDBOSVER OsVerInfo; 307 314 rtR0NtGetOsVersionInfo(&OsVerInfo); 315 316 /* Publish the version info in globals. */ 317 g_uRtNtVersion = RTNT_MAKE_VERSION(OsVerInfo.uMajorVer, OsVerInfo.uMinorVer); 318 g_uRtNtMinorVer = OsVerInfo.uMinorVer; 319 g_uRtNtMajorVer = OsVerInfo.uMajorVer; 320 g_uRtNtBuildNo = OsVerInfo.uBuildNo; 308 321 309 322 /* -
trunk/src/VBox/Runtime/r0drv/nt/internal-r0drv-nt.h
r64281 r65413 92 92 extern uint32_t g_offrtNtPbDpcQueueDepth; 93 93 94 /** Makes an NT version for checking against g_uRtNtVersion. */ 95 #define RTNT_MAKE_VERSION(uMajor, uMinor) RT_MAKE_U32(uMinor, uMajor) 96 97 extern uint32_t g_uRtNtVersion; 98 extern uint8_t g_uRtNtMajorVer; 99 extern uint8_t g_uRtNtMinorVer; 100 extern uint32_t g_uRtNtBuildNo; 101 94 102 95 103 int __stdcall rtMpPokeCpuUsingDpc(RTCPUID idCpu); -
trunk/src/VBox/Runtime/r0drv/nt/the-nt-kernel.h
r62477 r65413 64 64 #endif 65 65 66 /* Missing if we're compiling against older WDKs. */ 67 #ifndef NonPagedPoolNx 68 # define NonPagedPoolNx ((POOL_TYPE)512) 69 #endif 70 66 71 /* 67 72 * When targeting NT4 we have to undo some of the nice macros … … 77 82 # undef ExFreePool 78 83 NTKERNELAPI VOID NTAPI ExFreePool(IN PVOID P); 84 # undef NonPagedPoolNx 85 # define NonPagedPoolNx NonPagedPool 79 86 #endif /* IPRT_TARGET_NT4 */ 80 87
Note:
See TracChangeset
for help on using the changeset viewer.