Changeset 70149 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Dec 15, 2017 2:09:47 PM (7 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/nt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/nt/dbgkrnlinfo-r0drv-nt.cpp
r70136 r70149 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Initialization & Termination, R0 Driver, NT.3 * IPRT - Kernel Debug Information, R0 Driver, NT. 4 4 */ 5 5 … … 142 142 * Global Variables * 143 143 *********************************************************************************************************************************/ 144 /** Pointer to MmGetSystemRoutineAddress. */ 145 #ifdef RT_ARCH_X86 144 /** Pointer to MmGetSystemRoutineAddress. 145 * @note Added in NT v5.0. */ 146 #ifdef IPRT_TARGET_NT4 146 147 static decltype(MmGetSystemRoutineAddress) *g_pfnMmGetSystemRoutineAddress = NULL; 147 148 #else -
trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp
r69111 r70149 31 31 #include "the-nt-kernel.h" 32 32 #include <iprt/asm-amd64-x86.h> 33 #include <iprt/dbg.h> 33 34 #include <iprt/err.h> 34 35 #include <iprt/string.h> … … 84 85 /** KeDeregisterProcessorChangeCallback - Introducted in Windows 7. */ 85 86 PFNKEDEREGISTERPROCESSORCHANGECALLBACK g_pfnrtKeDeregisterProcessorChangeCallback; 87 /** Pointer to the MmProtectMdlSystemAddress kernel function if it's available. 88 * This API was introduced in XP. */ 89 decltype(MmProtectMdlSystemAddress) *g_pfnrtMmProtectMdlSystemAddress; 86 90 /** RtlGetVersion, introduced in ??. */ 87 91 PFNRTRTLGETVERSION g_pfnrtRtlGetVersion; … … 244 248 * Initialize the function pointers. 245 249 */ 246 #ifdef IPRT_TARGET_NT4 247 # define GET_SYSTEM_ROUTINE_EX(a_Prf, a_Name, a_pfnType) do { RT_CONCAT3(g_pfnrt, a_Prf, a_Name) = NULL; } while (0) 248 #else 249 UNICODE_STRING RoutineName; 250 # define GET_SYSTEM_ROUTINE_EX(a_Prf, a_Name, a_pfnType) \ 251 do { \ 252 RtlInitUnicodeString(&RoutineName, L#a_Name); \ 253 RT_CONCAT3(g_pfnrt, a_Prf, a_Name) = (a_pfnType)MmGetSystemRoutineAddress(&RoutineName); \ 254 } while (0) 255 #endif 250 RTDBGKRNLINFO hKrnlInfo; 251 int rc = RTR0DbgKrnlInfoOpen(&hKrnlInfo, 0/*fFlags*/); 252 AssertRCReturn(rc, rc); 253 254 #define GET_SYSTEM_ROUTINE_EX(a_Prf, a_Name, a_pfnType) \ 255 do { RT_CONCAT3(g_pfnrt, a_Prf, a_Name) = (a_pfnType)RTR0DbgKrnlInfoGetSymbol(hKrnlInfo, NULL, #a_Name); } while (0) 256 256 #define GET_SYSTEM_ROUTINE(a_Name) GET_SYSTEM_ROUTINE_EX(RT_NOTHING, a_Name, decltype(a_Name) *) 257 257 #define GET_SYSTEM_ROUTINE_PRF(a_Prf,a_Name) GET_SYSTEM_ROUTINE_EX(a_Prf, a_Name, decltype(a_Name) *) … … 276 276 GET_SYSTEM_ROUTINE(KeRegisterProcessorChangeCallback); 277 277 GET_SYSTEM_ROUTINE(KeDeregisterProcessorChangeCallback); 278 GET_SYSTEM_ROUTINE(MmProtectMdlSystemAddress); 278 279 279 280 GET_SYSTEM_ROUTINE_TYPE(RtlGetVersion, PFNRTRTLGETVERSION); … … 285 286 GET_SYSTEM_ROUTINE_TYPE(KeQuerySystemTimePrecise, PFNRTKEQUERYSYSTEMTIMEPRECISE); 286 287 287 #ifdef IPRT_TARGET_NT4 288 g_pfnrtHalRequestIpiW7Plus = NULL; 289 g_pfnrtHalRequestIpiPreW7 = NULL; 290 #else 291 RtlInitUnicodeString(&RoutineName, L"HalRequestIpi"); 292 g_pfnrtHalRequestIpiW7Plus = (PFNHALREQUESTIPI_W7PLUS)MmGetSystemRoutineAddress(&RoutineName); 288 g_pfnrtHalRequestIpiW7Plus = (PFNHALREQUESTIPI_W7PLUS)RTR0DbgKrnlInfoGetSymbol(hKrnlInfo, NULL, "HalRequestIpi"); 293 289 g_pfnrtHalRequestIpiPreW7 = (PFNHALREQUESTIPI_PRE_W7)g_pfnrtHalRequestIpiW7Plus; 294 #endif 290 291 RTR0DbgKrnlInfoRelease(hKrnlInfo); 295 292 296 293 /* … … 432 429 * we call rtR0TermNative to do the deregistration on failure. 433 430 */ 434 intrc = rtR0MpNtInit(&OsVerInfo);431 rc = rtR0MpNtInit(&OsVerInfo); 435 432 if (RT_FAILURE(rc)) 436 433 {
Note:
See TracChangeset
for help on using the changeset viewer.