MiSetImageProtection

VOID __stdcall MiSetImageProtection(
        _KLDR_DATA_TABLE_ENTRY *DataTableEntry,
        VOID *VirtualAddress,
        UINT64 NumberOfBytes,
        UINT64 ProtectionMask){
  _MMPTE *PteBase; 

  PteBase = MmGetPteBase();
  MiSetSystemCodeProtection(
    DataTableEntry,
    (_MMPTE *)((char *)PteBase + (((unsigned __int64)VirtualAddress >> 9) & 0x7FFFFFFFF8i64)),
    (_MMPTE *)((char *)PteBase
             + ((((unsigned __int64)VirtualAddress + (unsigned int)NumberOfBytes - 1) >> 9) & 0x7FFFFFFFF8i64)),
    ProtectionMask);
}

Referenced by:

MiCompactServiceTable
MiProcessKernelCfgImageLoadConfig
MiResolveImageImports
MmChangeImageProtection
MmLoadSystemImageEx