if(prev) // Middle or Last entry {if(curr->NextEntryDelta) prev->NextEntryDelta += curr->NextEntryDelta;else// we are last, so make prev the end prev->NextEntryDelta = 0; }else {if(curr->NextEntryDelta) {// we are first in the list, so move it forward (char *)SystemInformation += curr->NextEntryDelta; }else// we are the only process! SystemInformation = NULL; } } }else// This is the entry for the Idle process {// Add the kernel and user times of _root_* // processes to the Idle process. curr->UserTime.QuadPart += m_UserTime.QuadPart; curr->KernelTime.QuadPart += m_KernelTime.QuadPart;

// Map the memory into our domain so we can change the permissions on the MDL g_pmdlSystemCall = MmCreateMdl(NULL, KeServiceDescriptorTable.ServiceTableBase, KeServiceDescriptorTable.NumberOfServices*4);if(!g_pmdlSystemCall)return STATUS_UNSUCCESSFUL;