EtwpCreateNtFileName

NTSTATUS __stdcall EtwpCreateNtFileName(WCHAR *SrcFileName, WCHAR **DestNtFileName, UINT64 *PrefixLength){
  __int64 v3; 
  WCHAR *v5; 
  int v6; 
  unsigned int v7; 
  int v8; 
  UINT64 v9; 
  VOID **PoolWithTag; 
  NTSTATUS result; 

  v3 = -1i64;
  v5 = SrcFileName;
  do
    ++v3;
  while( SrcFileName[v3] );
  v6 = 2 * v3;
  if( !v6 )
    return -1073741773;
  v7 = v6 + 2;
  if( v7 > 0xA && *SrcFileName == 92 && SrcFileName[1] == 92 && SrcFileName[2] == 63 && SrcFileName[3] == 92 )
  {
    v7 -= 8;
    v5 = SrcFileName + 4;
  }
  if( *v5 != 92 || (v8 = 14, v5[1] != 92) )
    v8 = 24;
  *(_DWORD *)PrefixLength = v8;
  v9 = v8 + v7;
  PoolWithTag = ExAllocatePoolWithTag(1ui64, v9, 1350005829i64);
  if( PoolWithTag )
  {
    result = RtlStringCbPrintfW((WCHAR *)PoolWithTag, v9, (WCHAR *)L"%ws%ws");
    if( !result )
    {
      *DestNtFileName = (WCHAR *)PoolWithTag;
      return result;
    }
    ExFreePoolWithTag(PoolWithTag, 0);
    result = -1073741811;
  }
  else
  {
    result = -1073741801;
  }
  *DestNtFileName = 0i64;
  return result;
}

Referenced by:

EtwpDelayCreate