PsRegisterAltSystemCallHandler

INT64 __fastcall PsRegisterAltSystemCallHandler(INT64 a1, UINT64 a2){
  __int64 v2; 
  _ETHREAD *CurrentThread; 
  v2 = (int)a2;
  if( !a1 || (unsigned int)a2 >= 2 )
    KeBugCheckEx(0x1E0u, 2ui64, 0i64, 0i64, 0i64);
  if( !(_DWORD)a2 )
    KeBugCheckEx(0x1E0u, 3ui64, 0i64, 0i64, 0i64);
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  --*((_WORD *)CurrentThread + 242);
  ExAcquirePushLockExclusiveEx((UINT64)&PsAltSystemCallRegistrationLock, 0i64);
  if( PsAltSystemCallHandlers[v2] )
  {
    ExReleasePushLockEx((UINT64)&PsAltSystemCallRegistrationLock, 0i64);
    KeLeaveCriticalRegion();
    KeBugCheckEx(0x1E0u, 1ui64, PsAltSystemCallHandlers[v2], 0i64, 0i64);
  }
  PsAltSystemCallHandlers[v2] = a1;
  ExReleasePushLockEx((UINT64)&PsAltSystemCallRegistrationLock, 0i64);
  KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
  return 0i64;
}

Referenced by:

No references.