VirtualBox

source: vbox/trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp@ 68123

Last change on this file since 68123 was 65414, checked in by vboxsync, 8 years ago

IPRT/r0drv/nt: Preps for using NonPagedPoolNx.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 18.8 KB
Line 
1/* $Id: initterm-r0drv-nt.cpp 65414 2017-01-24 10:32:58Z vboxsync $ */
2/** @file
3 * IPRT - Initialization & Termination, R0 Driver, NT.
4 */
5
6/*
7 * Copyright (C) 2006-2016 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27
28/*********************************************************************************************************************************
29* Header Files *
30*********************************************************************************************************************************/
31#include "the-nt-kernel.h"
32#include <iprt/asm-amd64-x86.h>
33#include <iprt/err.h>
34#include <iprt/string.h>
35#include "internal/initterm.h"
36#include "internal-r0drv-nt.h"
37#include "symdb.h"
38#include "symdbdata.h"
39
40
41/*********************************************************************************************************************************
42* Global Variables *
43*********************************************************************************************************************************/
44/** ExSetTimerResolution, introduced in W2K. */
45PFNMYEXSETTIMERRESOLUTION g_pfnrtNtExSetTimerResolution;
46/** KeFlushQueuedDpcs, introduced in XP. */
47PFNMYKEFLUSHQUEUEDDPCS g_pfnrtNtKeFlushQueuedDpcs;
48/** HalRequestIpi, version introduced with windows 7. */
49PFNHALREQUESTIPI_W7PLUS g_pfnrtHalRequestIpiW7Plus;
50/** HalRequestIpi, version valid up to windows vista?? */
51PFNHALREQUESTIPI_PRE_W7 g_pfnrtHalRequestIpiPreW7;
52/** Worker for RTMpPokeCpu. */
53PFNRTSENDIPI g_pfnrtMpPokeCpuWorker;
54/** KeIpiGenericCall - Introduced in Windows Server 2003. */
55PFNRTKEIPIGENERICCALL g_pfnrtKeIpiGenericCall;
56/** KeSetTargetProcessorDpcEx - Introduced in Windows 7. */
57PFNKESETTARGETPROCESSORDPCEX g_pfnrtKeSetTargetProcessorDpcEx;
58/** KeInitializeAffinityEx - Introducted in Windows 7. */
59PFNKEINITIALIZEAFFINITYEX g_pfnrtKeInitializeAffinityEx;
60/** KeAddProcessorAffinityEx - Introducted in Windows 7. */
61PFNKEADDPROCESSORAFFINITYEX g_pfnrtKeAddProcessorAffinityEx;
62/** KeGetProcessorIndexFromNumber - Introducted in Windows 7. */
63PFNKEGETPROCESSORINDEXFROMNUMBER g_pfnrtKeGetProcessorIndexFromNumber;
64/** KeGetProcessorNumberFromIndex - Introducted in Windows 7. */
65PFNKEGETPROCESSORNUMBERFROMINDEX g_pfnrtKeGetProcessorNumberFromIndex;
66/** KeGetCurrentProcessorNumberEx - Introducted in Windows 7. */
67PFNKEGETCURRENTPROCESSORNUMBEREX g_pfnrtKeGetCurrentProcessorNumberEx;
68/** KeQueryActiveProcessors - Introducted in Windows 2000. */
69PFNKEQUERYACTIVEPROCESSORS g_pfnrtKeQueryActiveProcessors;
70/** KeQueryMaximumProcessorCount - Introducted in Vista and obsoleted W7. */
71PFNKEQUERYMAXIMUMPROCESSORCOUNT g_pfnrtKeQueryMaximumProcessorCount;
72/** KeQueryMaximumProcessorCountEx - Introducted in Windows 7. */
73PFNKEQUERYMAXIMUMPROCESSORCOUNTEX g_pfnrtKeQueryMaximumProcessorCountEx;
74/** KeQueryMaximumGroupCount - Introducted in Windows 7. */
75PFNKEQUERYMAXIMUMGROUPCOUNT g_pfnrtKeQueryMaximumGroupCount;
76/** KeQueryActiveProcessorCount - Introducted in Vista and obsoleted W7. */
77PFNKEQUERYACTIVEPROCESSORCOUNT g_pfnrtKeQueryActiveProcessorCount;
78/** KeQueryActiveProcessorCountEx - Introducted in Windows 7. */
79PFNKEQUERYACTIVEPROCESSORCOUNTEX g_pfnrtKeQueryActiveProcessorCountEx;
80/** KeQueryLogicalProcessorRelationship - Introducted in Windows 7. */
81PFNKEQUERYLOGICALPROCESSORRELATIONSHIP g_pfnrtKeQueryLogicalProcessorRelationship;
82/** KeRegisterProcessorChangeCallback - Introducted in Windows 7. */
83PFNKEREGISTERPROCESSORCHANGECALLBACK g_pfnrtKeRegisterProcessorChangeCallback;
84/** KeDeregisterProcessorChangeCallback - Introducted in Windows 7. */
85PFNKEDEREGISTERPROCESSORCHANGECALLBACK g_pfnrtKeDeregisterProcessorChangeCallback;
86/** RtlGetVersion, introduced in ??. */
87PFNRTRTLGETVERSION g_pfnrtRtlGetVersion;
88#ifndef RT_ARCH_AMD64
89/** KeQueryInterruptTime - exported/new in Windows 2000. */
90PFNRTKEQUERYINTERRUPTTIME g_pfnrtKeQueryInterruptTime;
91/** KeQuerySystemTime - exported/new in Windows 2000. */
92PFNRTKEQUERYSYSTEMTIME g_pfnrtKeQuerySystemTime;
93#endif
94/** KeQueryInterruptTimePrecise - new in Windows 8. */
95PFNRTKEQUERYINTERRUPTTIMEPRECISE g_pfnrtKeQueryInterruptTimePrecise;
96/** KeQuerySystemTimePrecise - new in Windows 8. */
97PFNRTKEQUERYSYSTEMTIMEPRECISE g_pfnrtKeQuerySystemTimePrecise;
98
99/** Offset of the _KPRCB::QuantumEnd field. 0 if not found. */
100uint32_t g_offrtNtPbQuantumEnd;
101/** Size of the _KPRCB::QuantumEnd field. 0 if not found. */
102uint32_t g_cbrtNtPbQuantumEnd;
103/** Offset of the _KPRCB::DpcQueueDepth field. 0 if not found. */
104uint32_t g_offrtNtPbDpcQueueDepth;
105
106/** The combined NT version, see RTNT_MAKE_VERSION. */
107uint32_t g_uRtNtVersion;
108/** The major version number. */
109uint8_t g_uRtNtMajorVer;
110/** The minor version number. */
111uint8_t g_uRtNtMinorVer;
112/** The build number. */
113uint32_t g_uRtNtBuildNo;
114
115
116/**
117 * Determines the NT kernel verison information.
118 *
119 * @param pOsVerInfo Where to return the version information.
120 *
121 * @remarks pOsVerInfo->fSmp is only definitive if @c true.
122 * @remarks pOsVerInfo->uCsdNo is set to MY_NIL_CSD if it cannot be determined.
123 */
124static void rtR0NtGetOsVersionInfo(PRTNTSDBOSVER pOsVerInfo)
125{
126 ULONG ulMajorVersion = 0;
127 ULONG ulMinorVersion = 0;
128 ULONG ulBuildNumber = 0;
129
130 pOsVerInfo->fChecked = PsGetVersion(&ulMajorVersion, &ulMinorVersion, &ulBuildNumber, NULL) == TRUE;
131 pOsVerInfo->uMajorVer = (uint8_t)ulMajorVersion;
132 pOsVerInfo->uMinorVer = (uint8_t)ulMinorVersion;
133 pOsVerInfo->uBuildNo = ulBuildNumber;
134#define MY_NIL_CSD 0x3f
135 pOsVerInfo->uCsdNo = MY_NIL_CSD;
136
137 if (g_pfnrtRtlGetVersion)
138 {
139 RTL_OSVERSIONINFOEXW VerInfo;
140 RT_ZERO(VerInfo);
141 VerInfo.dwOSVersionInfoSize = sizeof(VerInfo);
142
143 NTSTATUS rcNt = g_pfnrtRtlGetVersion(&VerInfo);
144 if (NT_SUCCESS(rcNt))
145 pOsVerInfo->uCsdNo = VerInfo.wServicePackMajor;
146 }
147
148 /* Note! We cannot quite say if something is MP or UNI. So, fSmp is
149 redefined to indicate that it must be MP.
150 Note! RTMpGetCount is not available here. */
151 pOsVerInfo->fSmp = ulMajorVersion >= 6; /* Vista and later has no UNI kernel AFAIK. */
152 if (!pOsVerInfo->fSmp)
153 {
154 if ( g_pfnrtKeQueryMaximumProcessorCountEx
155 && g_pfnrtKeQueryMaximumProcessorCountEx(ALL_PROCESSOR_GROUPS) > 1)
156 pOsVerInfo->fSmp = true;
157 else if ( g_pfnrtKeQueryMaximumProcessorCount
158 && g_pfnrtKeQueryMaximumProcessorCount() > 1)
159 pOsVerInfo->fSmp = true;
160 else if ( g_pfnrtKeQueryActiveProcessors
161 && g_pfnrtKeQueryActiveProcessors() > 1)
162 pOsVerInfo->fSmp = true;
163 else if (KeNumberProcessors > 1)
164 pOsVerInfo->fSmp = true;
165 }
166}
167
168
169/**
170 * Tries a set against the current kernel.
171 *
172 * @retval true if it matched up, global variables are updated.
173 * @retval false otherwise (no globals updated).
174 * @param pSet The data set.
175 * @param pbPrcb Pointer to the processor control block.
176 * @param pszVendor Pointer to the processor vendor string.
177 * @param pOsVerInfo The OS version info.
178 */
179static bool rtR0NtTryMatchSymSet(PCRTNTSDBSET pSet, uint8_t *pbPrcb, const char *pszVendor, PCRTNTSDBOSVER pOsVerInfo)
180{
181 /*
182 * Don't bother trying stuff where the NT kernel version number differs, or
183 * if the build type or SMPness doesn't match up.
184 */
185 if ( pSet->OsVerInfo.uMajorVer != pOsVerInfo->uMajorVer
186 || pSet->OsVerInfo.uMinorVer != pOsVerInfo->uMinorVer
187 || pSet->OsVerInfo.fChecked != pOsVerInfo->fChecked
188 || (!pSet->OsVerInfo.fSmp && pOsVerInfo->fSmp /*must-be-smp*/) )
189 {
190 //DbgPrint("IPRT: #%d Version/type mismatch.\n", pSet - &g_artNtSdbSets[0]);
191 return false;
192 }
193
194 /*
195 * Do the CPU vendor test.
196 *
197 * Note! The MmIsAddressValid call is the real #PF security here as the
198 * __try/__except has limited/no ability to catch everything we need.
199 */
200 char *pszPrcbVendorString = (char *)&pbPrcb[pSet->KPRCB.offVendorString];
201 if (!MmIsAddressValid(&pszPrcbVendorString[4 * 3 - 1]))
202 {
203 //DbgPrint("IPRT: #%d invalid vendor string address.\n", pSet - &g_artNtSdbSets[0]);
204 return false;
205 }
206 __try
207 {
208 if (memcmp(pszPrcbVendorString, pszVendor, RT_MIN(4 * 3, pSet->KPRCB.cbVendorString)) != 0)
209 {
210 //DbgPrint("IPRT: #%d Vendor string mismatch.\n", pSet - &g_artNtSdbSets[0]);
211 return false;
212 }
213 }
214 __except(EXCEPTION_EXECUTE_HANDLER)
215 {
216 DbgPrint("IPRT: %#d Exception\n", pSet - &g_artNtSdbSets[0]);
217 return false;
218 }
219
220 /*
221 * Got a match, update the global variables and report succcess.
222 */
223 g_offrtNtPbQuantumEnd = pSet->KPRCB.offQuantumEnd;
224 g_cbrtNtPbQuantumEnd = pSet->KPRCB.cbQuantumEnd;
225 g_offrtNtPbDpcQueueDepth = pSet->KPRCB.offDpcQueueDepth;
226
227#if 0
228 DbgPrint("IPRT: Using data set #%u for %u.%usp%u build %u %s %s.\n",
229 pSet - &g_artNtSdbSets[0],
230 pSet->OsVerInfo.uMajorVer,
231 pSet->OsVerInfo.uMinorVer,
232 pSet->OsVerInfo.uCsdNo,
233 pSet->OsVerInfo.uBuildNo,
234 pSet->OsVerInfo.fSmp ? "smp" : "uni",
235 pSet->OsVerInfo.fChecked ? "checked" : "free");
236#endif
237 return true;
238}
239
240
241DECLHIDDEN(int) rtR0InitNative(void)
242{
243 /*
244 * Initialize the function pointers.
245 */
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
256#define GET_SYSTEM_ROUTINE(a_Name) GET_SYSTEM_ROUTINE_EX(RT_NOTHING, a_Name, decltype(a_Name) *)
257#define GET_SYSTEM_ROUTINE_PRF(a_Prf,a_Name) GET_SYSTEM_ROUTINE_EX(a_Prf, a_Name, decltype(a_Name) *)
258#define GET_SYSTEM_ROUTINE_TYPE(a_Name, a_pfnType) GET_SYSTEM_ROUTINE_EX(RT_NOTHING, a_Name, a_pfnType)
259
260 GET_SYSTEM_ROUTINE_PRF(Nt,ExSetTimerResolution);
261 GET_SYSTEM_ROUTINE_PRF(Nt,KeFlushQueuedDpcs);
262 GET_SYSTEM_ROUTINE(KeIpiGenericCall);
263 GET_SYSTEM_ROUTINE(KeSetTargetProcessorDpcEx);
264 GET_SYSTEM_ROUTINE(KeInitializeAffinityEx);
265 GET_SYSTEM_ROUTINE(KeAddProcessorAffinityEx);
266 GET_SYSTEM_ROUTINE_TYPE(KeGetProcessorIndexFromNumber, PFNKEGETPROCESSORINDEXFROMNUMBER);
267 GET_SYSTEM_ROUTINE(KeGetProcessorNumberFromIndex);
268 GET_SYSTEM_ROUTINE_TYPE(KeGetCurrentProcessorNumberEx, PFNKEGETCURRENTPROCESSORNUMBEREX);
269 GET_SYSTEM_ROUTINE(KeQueryActiveProcessors);
270 GET_SYSTEM_ROUTINE(KeQueryMaximumProcessorCount);
271 GET_SYSTEM_ROUTINE(KeQueryMaximumProcessorCountEx);
272 GET_SYSTEM_ROUTINE(KeQueryMaximumGroupCount);
273 GET_SYSTEM_ROUTINE(KeQueryActiveProcessorCount);
274 GET_SYSTEM_ROUTINE(KeQueryActiveProcessorCountEx);
275 GET_SYSTEM_ROUTINE(KeQueryLogicalProcessorRelationship);
276 GET_SYSTEM_ROUTINE(KeRegisterProcessorChangeCallback);
277 GET_SYSTEM_ROUTINE(KeDeregisterProcessorChangeCallback);
278
279 GET_SYSTEM_ROUTINE_TYPE(RtlGetVersion, PFNRTRTLGETVERSION);
280#ifndef RT_ARCH_AMD64
281 GET_SYSTEM_ROUTINE(KeQueryInterruptTime);
282 GET_SYSTEM_ROUTINE(KeQuerySystemTime);
283#endif
284 GET_SYSTEM_ROUTINE_TYPE(KeQueryInterruptTimePrecise, PFNRTKEQUERYINTERRUPTTIMEPRECISE);
285 GET_SYSTEM_ROUTINE_TYPE(KeQuerySystemTimePrecise, PFNRTKEQUERYSYSTEMTIMEPRECISE);
286
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);
293 g_pfnrtHalRequestIpiPreW7 = (PFNHALREQUESTIPI_PRE_W7)g_pfnrtHalRequestIpiW7Plus;
294#endif
295
296 /*
297 * HACK ALERT! (and déjà vu warning - remember win32k.sys?)
298 *
299 * Try find _KPRCB::QuantumEnd and _KPRCB::[DpcData.]DpcQueueDepth.
300 * For purpose of verification we use the VendorString member (12+1 chars).
301 *
302 * The offsets was initially derived by poking around with windbg
303 * (dt _KPRCB, !prcb ++, and such like). Systematic harvesting was then
304 * planned using dia2dump, grep and the symbol pack in a manner like this:
305 * dia2dump -type _KDPC_DATA -type _KPRCB EXE\ntkrnlmp.pdb | grep -wE "QuantumEnd|DpcData|DpcQueueDepth|VendorString"
306 *
307 * The final solution ended up using a custom harvester program called
308 * ntBldSymDb that recursively searches thru unpacked symbol packages for
309 * the desired structure offsets. The program assumes that the packages
310 * are unpacked into directories with the same name as the package, with
311 * exception of some of the w2k packages which requires a 'w2k' prefix to
312 * be distinguishable from another.
313 */
314
315 RTNTSDBOSVER OsVerInfo;
316 rtR0NtGetOsVersionInfo(&OsVerInfo);
317
318 /* Publish the version info in globals. */
319 g_uRtNtVersion = RTNT_MAKE_VERSION(OsVerInfo.uMajorVer, OsVerInfo.uMinorVer);
320 g_uRtNtMinorVer = OsVerInfo.uMinorVer;
321 g_uRtNtMajorVer = OsVerInfo.uMajorVer;
322 g_uRtNtBuildNo = OsVerInfo.uBuildNo;
323
324 /*
325 * Gather consistent CPU vendor string and PRCB pointers.
326 */
327 KIRQL OldIrql;
328 KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); /* make sure we stay on the same cpu */
329
330 union
331 {
332 uint32_t auRegs[4];
333 char szVendor[4*3+1];
334 } u;
335 ASMCpuId(0, &u.auRegs[3], &u.auRegs[0], &u.auRegs[2], &u.auRegs[1]);
336 u.szVendor[4*3] = '\0';
337
338 uint8_t *pbPrcb;
339 __try /* Warning. This try/except statement may provide some false safety. */
340 {
341#if defined(RT_ARCH_X86)
342 PKPCR pPcr = (PKPCR)__readfsdword(RT_OFFSETOF(KPCR,SelfPcr));
343 pbPrcb = (uint8_t *)pPcr->Prcb;
344#elif defined(RT_ARCH_AMD64)
345 PKPCR pPcr = (PKPCR)__readgsqword(RT_OFFSETOF(KPCR,Self));
346 pbPrcb = (uint8_t *)pPcr->CurrentPrcb;
347#else
348# error "port me"
349 pbPrcb = NULL;
350#endif
351 }
352 __except(EXCEPTION_EXECUTE_HANDLER)
353 {
354 pbPrcb = NULL;
355 }
356
357 /*
358 * Search the database
359 */
360 if (pbPrcb)
361 {
362 /* Find the best matching kernel version based on build number. */
363 uint32_t iBest = UINT32_MAX;
364 int32_t iBestDelta = INT32_MAX;
365 for (uint32_t i = 0; i < RT_ELEMENTS(g_artNtSdbSets); i++)
366 {
367 if (g_artNtSdbSets[i].OsVerInfo.fChecked != OsVerInfo.fChecked)
368 continue;
369 if (OsVerInfo.fSmp /*must-be-smp*/ && !g_artNtSdbSets[i].OsVerInfo.fSmp)
370 continue;
371
372 int32_t iDelta = RT_ABS((int32_t)OsVerInfo.uBuildNo - (int32_t)g_artNtSdbSets[i].OsVerInfo.uBuildNo);
373 if ( iDelta == 0
374 && (g_artNtSdbSets[i].OsVerInfo.uCsdNo == OsVerInfo.uCsdNo || OsVerInfo.uCsdNo == MY_NIL_CSD))
375 {
376 /* prefect */
377 iBestDelta = iDelta;
378 iBest = i;
379 break;
380 }
381 if ( iDelta < iBestDelta
382 || iBest == UINT32_MAX
383 || ( iDelta == iBestDelta
384 && OsVerInfo.uCsdNo != MY_NIL_CSD
385 && RT_ABS(g_artNtSdbSets[i ].OsVerInfo.uCsdNo - (int32_t)OsVerInfo.uCsdNo)
386 < RT_ABS(g_artNtSdbSets[iBest].OsVerInfo.uCsdNo - (int32_t)OsVerInfo.uCsdNo)
387 )
388 )
389 {
390 iBestDelta = iDelta;
391 iBest = i;
392 }
393 }
394 if (iBest < RT_ELEMENTS(g_artNtSdbSets))
395 {
396 /* Try all sets: iBest -> End; iBest -> Start. */
397 bool fDone = false;
398 int32_t i = iBest;
399 while ( i < RT_ELEMENTS(g_artNtSdbSets)
400 && !(fDone = rtR0NtTryMatchSymSet(&g_artNtSdbSets[i], pbPrcb, u.szVendor, &OsVerInfo)))
401 i++;
402 if (!fDone)
403 {
404 i = (int32_t)iBest - 1;
405 while ( i >= 0
406 && !(fDone = rtR0NtTryMatchSymSet(&g_artNtSdbSets[i], pbPrcb, u.szVendor, &OsVerInfo)))
407 i--;
408 }
409 }
410 else
411 DbgPrint("IPRT: Failed to locate data set.\n");
412 }
413 else
414 DbgPrint("IPRT: Failed to get PCBR pointer.\n");
415
416 KeLowerIrql(OldIrql); /* Lowering the IRQL early in the hope that we may catch exceptions below. */
417
418#ifndef IN_GUEST
419 if (!g_offrtNtPbQuantumEnd && !g_offrtNtPbDpcQueueDepth)
420 DbgPrint("IPRT: Neither _KPRCB::QuantumEnd nor _KPRCB::DpcQueueDepth was not found! Kernel %u.%u %u %s\n",
421 OsVerInfo.uMajorVer, OsVerInfo.uMinorVer, OsVerInfo.uBuildNo, OsVerInfo.fChecked ? "checked" : "free");
422# ifdef DEBUG
423 else
424 DbgPrint("IPRT: _KPRCB:{.QuantumEnd=%x/%d, .DpcQueueDepth=%x/%d} Kernel %u.%u %u %s\n",
425 g_offrtNtPbQuantumEnd, g_cbrtNtPbQuantumEnd, g_offrtNtPbDpcQueueDepth, g_offrtNtPbDpcQueueDepth,
426 OsVerInfo.uMajorVer, OsVerInfo.uMinorVer, OsVerInfo.uBuildNo, OsVerInfo.fChecked ? "checked" : "free");
427# endif
428#endif
429
430 /*
431 * Initialize multi processor stuff. This registers a callback, so
432 * we call rtR0TermNative to do the deregistration on failure.
433 */
434 int rc = rtR0MpNtInit(&OsVerInfo);
435 if (RT_FAILURE(rc))
436 {
437 rtR0TermNative();
438 DbgPrint("IPRT: Fatal: rtR0MpNtInit failed: %d\n", rc);
439 return rc;
440 }
441
442 return VINF_SUCCESS;
443}
444
445
446DECLHIDDEN(void) rtR0TermNative(void)
447{
448 rtR0MpNtTerm();
449}
450
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette