PspAttachSession

NTSTATUS __stdcall PspAttachSession(UINT64 SessionId, KAPC_STATE *ApcState, PVOID *pSession){
  struct _DMA_ADAPTER *v5; 
  struct _DMA_ADAPTER *v6; 
  int v7; 
  LODWORD(v5) = MmGetSessionById(SessionId);
  v6 = v5;
  if( !v5 )
    return -1073741558;
  *pSession = v5;
  v7 = MmAttachSession(v5, ApcState);
  if( v7 < 0 )
    HalPutDmaAdapter(v6);
  return v7;
}

Referenced by:

PspAllocateProcess