ExFetchLicenseData

__int64 __fastcall ExFetchLicenseData(VOID *a1, unsigned int a2, unsigned int *a3){
  struct _EXP_LICENSE_STATE *ExpLicenseState; 
  _ETHREAD *CurrentThread; 
  unsigned int *v9; 
  unsigned int v10; 

  v10 = 0;
  ExpLicenseState = PsGetCurrentServerSiloGlobals((_KSPIN_LOCK *)a1)->ExpLicenseState;
  if( !a3 )
    return 3221225485i64;
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  --CurrentThread->Tcb.KernelApcDisable;
  ExAcquirePushLockSharedEx((_EX_PUSH_LOCK *)ExpLicenseState + 5855, 0i64);
  if( *((_BYTE *)ExpLicenseState + 46992) )
    goto LABEL_4;
  v9 = (unsigned int *)*((_QWORD *)ExpLicenseState + 5854);
  if( *(_QWORD *)ExpLicenseState )
    v9 = *(unsigned int **)ExpLicenseState;
  if( !v9 )
  {
LABEL_4:
    v10 = -1073741595;
  }
  else
  {
    *a3 = *v9;
    if( a1 && a2 && a2 >= *v9 )
    {
      memmove(a1, v9, *v9);
      if( a2 >= 0x14 )
        *((_DWORD *)a1 + 3) &= ~1u;
    }
    else
    {
      v10 = -1073741789;
    }
  }
  if( _InterlockedCompareExchange64((volatile signed __int64 *)ExpLicenseState + 5855, 0i64, 17i64) != 17 )
    ExfReleasePushLockShared((_EX_PUSH_LOCK *)ExpLicenseState + 5855);
  KeAbPostRelease((char *)ExpLicenseState + 46840);
  KeLeaveCriticalRegionThread(KeGetCurrentThread());
  return v10;
}

Referenced by:

No references.