AlpcpCaptureViewAttributeInternal

INT64 __fastcall AlpcpCaptureViewAttributeInternal(INT64 a1, INT64 *a2, INT64 a3, INT64 a4){
  ULONG_PTR v8; 
  VOID *v9; 
  INT64 v10; 
  __int64 v11; 
  _EX_PUSH_LOCK *v12; 
  _EX_PUSH_LOCK *v13; 
  int v14; 
  int v15; 
  bool v16; 
  void *v17; 
  ULONG_PTR BugCheckParameter2; 
  if( (*(_DWORD *)a2 & 0xFFF8FFFF) != 0 )
    return 3221225485i64;
  v8 = *(_QWORD *)(a3 + 144);
  BugCheckParameter2 = v8;
  if( v8 )
  {
    *(_QWORD *)(a3 + 144) = 0i64;
    AlpcpLockForCachedReferenceBlob(*(PVOID *)(v8 + 16));
    --*(_DWORD *)(v8 + 76);
    AlpcpUnlockBlob(*(PVOID *)(v8 + 16));
    if( (*(_DWORD *)a2 & 0x10000) != 0 )
      AlpcpDeleteView(v8);
    AlpcpDereferenceBlobEx((PVOID)v8, 1i64);
  }
  *(_DWORD *)(a3 + 40) &= ~0x4000u;
  v9 = (VOID *)a2[1];
  if( !v9 )
    return 0i64;
  v10 = a2[2];
  if( !v10 )
    return 3221225793i64;
  v11 = *(_QWORD *)(a1 + 16);
  if( !v11 )
    return 3221225480i64;
  v12 = AlpcReferenceBlobByHandle((_ALPC_HANDLE_TABLE *)(v11 + 40), v9, &AlpcSectionType);
  v13 = v12;
  if( !v12 )
    return 3221225480i64;
  v14 = AlpcpLocateSectionView((INT64)v12, a1, v10, &BugCheckParameter2);
  if( v14 >= 0 )
  {
    v15 = *(_DWORD *)a2;
    v16 = (*(_DWORD *)a2 & 0x40000) != 0 && (*(_DWORD *)&v13[6].0 & 2) != 0;
    v17 = (void *)BugCheckParameter2;
    v14 = AlpcpPrepareViewForDelivery(BugCheckParameter2, v16, (v15 & 0x20000) != 0);
    if( v14 < 0 )
      AlpcpDereferenceBlobEx(v17, 1i64);
    else
      *(_QWORD *)(a4 + 40) = v17;
  }
  AlpcpDereferenceBlobEx(v13, 1i64);
  return(unsigned int)v14;
}

Referenced by:

AlpcpCaptureViewAttribute
AlpcpCaptureViewAttribute32