NtAlpcCreatePortSection

NTSTATUS __stdcall NtAlpcCreatePortSection(
        PVOID PortHandle,
        UINT64 Flags,
        PVOID SectionHandle,
        UINT64 SectionSize,
        PVOID *AlpcSectionHandle,
        UINT64 *ActualSectionSize){
  _ETHREAD *CurrentThread; 
  char v10; 
  NTSTATUS v11; 
  UINT8 v12; 
  __int64 v13; 
  __int64 v14; 
  KPROCESSOR_MODE v15; 
  VOID *v16; 
  struct _DMA_ADAPTER *v17; 
  UINT64 *v18; 
  ULONG_PTR BugCheckParameter2; 
  PVOID Object; 
  BugCheckParameter2 = 0i64;
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  --*((_WORD *)CurrentThread + 242);
  v10 = *((_BYTE *)KeGetCurrentThread() + 562);
  if( (Flags & 0xFFFBFFFF) != 0 )
    goto LABEL_2;
  if( (Flags & 0x40000) != 0 )
  {
    if( SectionHandle )
    {
LABEL_2:
      v11 = -1073741811;
      goto LABEL_17;
    }
    v12 = 1;
  }
  else
  {
    v12 = 0;
  }
  if( v10 )
  {
    v13 = 0x7FFFFFFF0000i64;
    v14 = 0x7FFFFFFF0000i64;
    if( (unsigned __int64)AlpcSectionHandle < 0x7FFFFFFF0000i64 )
      v14 = (__int64)AlpcSectionHandle;
    *(_QWORD *)v14 = *(_QWORD *)v14;
    if( (unsigned __int64)ActualSectionSize < 0x7FFFFFFF0000i64 )
      v13 = (__int64)ActualSectionSize;
    *(_QWORD *)v13 = *(_QWORD *)v13;
  }
  v15 = *((_BYTE *)KeGetCurrentThread() + 562);
  Object = 0i64;
  v11 = ObReferenceObjectByHandle(PortHandle, 1u, AlpcPortObjectType, v15, &Object, 0i64);
  if( v11 >= 0 )
  {
    v16 = SectionHandle;
    v17 = (struct _DMA_ADAPTER *)Object;
    v11 = AlpcpCreateSection((CHAR *)Object, v12, 1, v16, SectionSize, &BugCheckParameter2);
    if( v11 >= 0 )
    {
      v18 = (UINT64 *)BugCheckParameter2;
      *AlpcSectionHandle = *(PVOID *)(BugCheckParameter2 + 24);
      *ActualSectionSize = v18[1];
      AlpcpDereferenceBlobEx(v18, 1i64);
    }
    HalPutDmaAdapter(v17);
  }
LABEL_17:
  KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
  return v11;
}

Referenced by:

No references.