EtwpCoverageSamplerSetBloomFilter

NTSTATUS __stdcall EtwpCoverageSamplerSetBloomFilter(PVOID BugCheckParameter2){
  __int64 v1; 
  INT8 v2; 
  _ADAPTER_OBJECT *v3; 
  __int64 v4; 
  int v6; 
  VOID *v7; 
  unsigned int v8; 
  NTSTATUS v9; 
  __int64 v10; 
  int v11; 
  _ETHREAD *CurrentThread; 
  VOID *v13; 
  int v14; 
  VOID *MappedBase; 
  PVOID Section; 
  UINT64 ViewSize; 

  MappedBase = 0i64;
  v3 = 0i64;
  v4 = v1;
  if( *(_DWORD *)(v1 + 12) != *((_DWORD *)BugCheckParameter2 + 7) )
    return -1073741811;
  v7 = *(VOID **)v1;
  v8 = *(_DWORD *)(v1 + 8);
  if( !*(_QWORD *)v1 )
  {
    if( !v8 && !*(_DWORD *)(v1 + 16) )
    {
      v11 = 0;
      goto LABEL_15;
    }
    goto LABEL_18;
  }
  if( !v8 || ((v8 - 1) & v8) != 0 || v8 > 0x8000000 || (unsigned int)(*(_DWORD *)(v1 + 16) - 1) > 9 )
    return -1073741811;
  Section = 0i64;
  v9 = ObReferenceObjectByHandle(v7, 4ui64, MmSectionObjectType, v2, &Section, 0i64);
  v3 = (_ADAPTER_OBJECT *)Section;
  v6 = v9;
  if( v9 >= 0 )
  {
    ViewSize = *(unsigned int *)(v4 + 8);
    v6 = MmMapViewInSystemSpace(Section, &MappedBase, &ViewSize);
    if( v6 < 0 )
      goto LABEL_19;
    v10 = *(unsigned int *)(v4 + 8);
    if( ViewSize == v10 )
    {
      v11 = 8 * v10 - 1;
LABEL_15:
      CurrentThread = (_ETHREAD *)KeGetCurrentThread();
      --CurrentThread->Tcb.KernelApcDisable;
      ExAcquirePushLockExclusiveEx((_EX_PUSH_LOCK *)BugCheckParameter2, 0i64);
      v13 = (VOID *)*((_QWORD *)BugCheckParameter2 + 149);
      *((_QWORD *)BugCheckParameter2 + 1) = KeGetCurrentThread();
      *((_QWORD *)BugCheckParameter2 + 149) = MappedBase;
      *((_DWORD *)BugCheckParameter2 + 300) = *(_DWORD *)(v4 + 8);
      *((_DWORD *)BugCheckParameter2 + 301) = v11;
      v14 = *(_DWORD *)(v4 + 16);
      *((_QWORD *)BugCheckParameter2 + 1) = 0i64;
      *((_DWORD *)BugCheckParameter2 + 302) = v14;
      MappedBase = v13;
      if( (_InterlockedExchangeAdd64((volatile signed __int64 *)BugCheckParameter2, 0xFFFFFFFFFFFFFFFFui64) & 6) == 2 )
        ExfTryToWakePushLock((_EX_PUSH_LOCK *)BugCheckParameter2);
      KeAbPostRelease(BugCheckParameter2);
      KeLeaveCriticalRegionThread(KeGetCurrentThread());
      v6 = 0;
      goto LABEL_19;
    }
LABEL_18:
    v6 = -1073741811;
LABEL_19:
    if( MappedBase )
      MmUnmapViewInSystemSpace(MappedBase);
  }
  if( v3 )
    HalPutDmaAdapter(v3);
  return v6;
}

Referenced by:

EtwpSetCoverageSamplerInformation