/* Call the generic handler with the system module list */
Status = ExpQueryModuleInformation(&PsLoadedModuleList,
&MmLoadedUserImageList,
- (PRTL_PROCESS_MODULES)Buffer,
- Size,
- ReqSize);
+ (PRTL_PROCESS_MODULES)Buffer,
+ Size,
+ ReqSize);
/* Release list lock and return status */
ExReleaseResourceLite(&PsLoadedModuleResource);
for (Count = 0; HandleCount > 0 ; HandleCount--)
{
- Shi->Handles[i].UniqueProcessId = (USHORT)(ULONG)pr->UniqueProcessId;
+ Shi->Handles[i].UniqueProcessId = (USHORT)(ULONG_PTR)pr->UniqueProcessId;
Count++;
i++;
}
QSI_DEF(SystemInterruptInformation)
{
PKPRCB Prcb;
+ PKPCR Pcr;
LONG i;
ULONG ti;
PSYSTEM_INTERRUPT_INFORMATION sii = (PSYSTEM_INTERRUPT_INFORMATION)Buffer;
for (i = 0; i < KeNumberProcessors; i++)
{
Prcb = KiProcessorBlock[i];
- sii->ContextSwitches = KeGetContextSwitches(Prcb);
+#ifdef _M_AMD64
+ Pcr = CONTAINING_RECORD(Prcb, KPCR, CurrentPrcb);
+#else
+ Pcr = CONTAINING_RECORD(Prcb, KPCR, Prcb);
+#endif
+#ifdef _M_ARM // This code should probably be done differently
+ sii->ContextSwitches = Pcr->ContextSwitches;
+#else
+ sii->ContextSwitches = ((PKIPCR)Pcr)->ContextSwitches;
+#endif
sii->DpcCount = Prcb->DpcData[0].DpcCount;
sii->DpcRate = Prcb->DpcRequestRate;
sii->TimeIncrement = ti;
PVOID SectionPointer = Buffer;
/* Validate size */
- if (Size != sizeof(PVOID))
+ if(Size != sizeof(PVOID))
{
/* Incorrect length, fail */
return STATUS_INFO_LENGTH_MISMATCH;
- }
+ }
/* Only kernel mode can call this function */
if (ExGetPreviousMode() != KernelMode) return STATUS_PRIVILEGE_NOT_HELD;
/* Unload the image */
MmUnloadSystemImage(SectionPointer);
return STATUS_SUCCESS;
-}
+ }
/* Class 28 - Time Adjustment Information */
QSI_DEF(SystemTimeAdjustmentInformation)
{
PAGED_CODE();
-#if defined(_M_IX86)
+#if defined(_M_IX86) || defined(_M_AMD64)
__wbinvd();
#elif defined(_M_PPC)
__asm__ __volatile__("tlbsync");