ApiSetpConstructPathToExtension

NTSTATUS __stdcall ApiSetpConstructPathToExtension(PCWSTR Source){
  __int16 v1; 
  struct _UNICODE_STRING *v2; 
  UINT64 v3; 
  struct _UNICODE_STRING *v4; 
  int appended; 
  wchar_t *Buffer; 
  struct _UNICODE_STRING Destination; 
  v3 = (unsigned __int16)(v1 + 44);
  v4 = v2;
  *(_QWORD *)&Destination.Length = 0i64;
  Destination.MaximumLength = v3;
  Destination.Buffer = (wchar_t *)ExAllocatePoolWithTag(PagedPool, v3, 0x68635341ui64);
  if( !Destination.Buffer )
    return -1073741801;
  appended = RtlAppendUnicodeToString(&Destination, (PWCHAR)L"\\SystemRoot\\System32\\");
  if( appended < 0 || (appended = RtlAppendUnicodeToString(&Destination, (PWCHAR)Source), appended < 0) )
  {
    Buffer = Destination.Buffer;
  }
  else
  {
    Buffer = 0i64;
    *v4 = Destination;
  }
  if( Buffer )
    ExFreePoolWithTag(Buffer, 0);
  return appended;
}

Referenced by:

ApiSetpLoadSchemaExtension