initterm-r0drv-nt.cpp revision 95222546f70bb121c5cb934da27875ea965831c9
2788N/A * IPRT - Initialization & Termination, R0 Driver, NT. 2788N/A * Copyright (C) 2006-2007 Sun Microsystems, Inc. 2788N/A * This file is part of VirtualBox Open Source Edition (OSE), as 2788N/A * you can redistribute it and/or modify it under the terms of the GNU 2788N/A * General Public License (GPL) as published by the Free Software 2788N/A * Foundation, in version 2 as it comes in the "COPYING" file of the 2788N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the 2788N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 2788N/A * The contents of this file may alternatively be used under the terms 2788N/A * of the Common Development and Distribution License Version 1.0 2788N/A * (CDDL) only, as it comes in the "COPYING.CDDL" file of the 2788N/A * VirtualBox OSE distribution, in which case the provisions of the 2788N/A * CDDL are applicable instead of those of the GPL. 2788N/A * You may elect to license modified versions of this file under the 2788N/A * terms and conditions of either the GPL or the CDDL or both. 4458N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa 2788N/A * additional information or have any questions. 2788N/A/******************************************************************************* 2788N/A*******************************************************************************/ 2788N/A/******************************************************************************* 2788N/A*******************************************************************************/ 2788N/A * KeQueryActiveProcssors() cannot be called at all IRQLs and therefore we'll 2788N/A * have to cache it. Fortunately, Nt doesn't really support taking CPUs offline 2788N/A * or online. It's first with W2K8 that support for CPU hotplugging was added. 2788N/A * Once we start caring about this, we'll simply let the native MP event callback 2788N/A * and update this variable as CPUs comes online. (The code is done already.) 2788N/A/** ExSetTimerResolution, introduced in W2K. */ 2788N/A/** KeFlushQueuedDpcs, introduced in XP. */ 2788N/A/** Offset of the _KPRCB::QuantumEnd field. 0 if not found. */ 2788N/A/** Size of the _KPRCB::QuantumEnd field. 0 if not found. */ 2788N/A/** Offset of the _KPRCB::DpcQueueDepth field. 0 if not found. */ 2788N/A * Initialize the function pointers. 2788N/A * Get some info that might come in handy below. 3951N/A * HACK ALERT (and d�j� vu warning)! 3951N/A * Try find _KPRCB::QuantumEnd and _KPRCB::[DpcData.]DpcQueueDepth. 3951N/A * For purpose of verification we use the VendorString member (12+1 chars). 3951N/A * The offsets was initially derived by poking around with windbg 2788N/A * (dt _KPRCB, !prcb ++, and such like). Systematic harvesting is now done 3194N/A * by means of dia2dump, grep and the symbol packs. Typically: 2788N/A * dia2dump -type _KDPC_DATA -type _KPRCB EXE\ntkrnlmp.pdb | grep -wE "QuantumEnd|DpcData|DpcQueueDepth|VendorString" 2788N/A /** @todo array w/ data + script for extracting a row. (save space + readability; table will be short.) */ 3600N/A /* WindowsVista.6002.090410-1830.x86fre.Symbols.exe 3600N/A WindowsVista.6002.090410-1830.x86chk.Symbols.exe 3600N/A WindowsVista.6002.090130-1715.x86fre.Symbols.exe 2788N/A WindowsVista.6002.090130-1715.x86chk.Symbols.exe */ 3951N/A //pbQuantumEnd = (uint8_t volatile *)pPcr->Prcb + 0x1a41; 3951N/A /* WindowsVista.6002.090410-1830.amd64fre.Symbols 3951N/A WindowsVista.6002.090130-1715.amd64fre.Symbols 3951N/A WindowsVista.6002.090410-1830.amd64chk.Symbols */ 3951N/A DbgPrint(
"IPRT: Neither _KPRCB::QuantumEnd nor _KPRCB::DpcQueueDepth was not found! Kernel %u.%u %u %s\n",
3951N/A DbgPrint(
"IPRT: _KPRCB:{.QuantumEnd=%x/%d, .DpcQueueDepth=%x/%d} Kernel %ul.%ul %ul %s\n",