MiFreeDriverInitialization

VOID __stdcall MiFreeDriverInitialization(_KLDR_DATA_TABLE_ENTRY *DataTableEntry){
  void *DllBase; 
  unsigned int v3; 
  _MMPTE *EndPte; 
  VOID *EndVa; 

  DllBase = DataTableEntry->DllBase;
  EndVa = 0i64;
  EndPte = 0i64;
  if( (!MI_IS_PHYSICAL_ADDRESS(DllBase) || DllBase == (void *)PsNtosImageBase || DllBase == PsHalImageBase)
    && (DataTableEntry->Flags & 0x800) == 0
    && (!dword_140CFA1D8 || DllBase != (void *)PsNtosImageBase && DllBase != PsHalImageBase) )
  {
    v3 = 0;
    do
    {
      v3 = MiSnapDriverRange(DataTableEntry, v3, 2ui64, 0i64, &EndPte);
      if( EndPte )
        MiFreeInitializationCode(DataTableEntry, EndPte, EndVa);
    }
    while( v3 );
  }
}

Referenced by:

IopLoadDriver
MiLoadImportDll
MmFreeBootDriverInitializationCode