SmPerformStoreSwapOperation

NTSTATUS __stdcall SmPerformStoreSwapOperation(_SM_STORE_SWAP_OPERATION Operation, VOID *OperationParam){
  bool v2; 
  _EPROCESS *Process; 

  if( Operation == SmStoreReleaseSwapSupport )
  {
    SC_ENV::Free(OperationParam);
    return 0;
  }
  else
  {
    v2 = Operation == SmStoreInSwap;
    Process = KeGetCurrentThread()->ApcState.Process;
    if( v2 )
      return MmInSwapVirtualAddresses(Process, OperationParam);
    else
      return MmOutSwapVirtualAddresses(
               Process,
               *((_MEMORY_RANGE_ENTRY **)OperationParam + 1),
               *((unsigned int *)OperationParam + 4),
               (VOID **)OperationParam);
  }
}

Referenced by:

SMKM_STORE::SmStInSwapStore
SMKM_STORE::SmStOutSwapStore