ExpCreateOutputNT

NTSTATUS __stdcall ExpCreateOutputNT(
        _FILE_PATH *OutputPath,
        UINT64 *OutputPathLength,
        _UNICODE_STRING *pDeviceNameString,
        WCHAR *pPathName){
  int v4; 
  __int64 v8; 
  unsigned int v9; 
  unsigned int v10; 
  unsigned int v11; 
  unsigned __int8 *FilePath; 
  unsigned int v13; 
  wchar_t *v14; 

  v4 = pDeviceNameString->Length + 2;
  if( pPathName )
  {
    v8 = -1i64;
    do
      ++v8;
    while( pPathName[v8] );
    v4 += 2 * v8;
  }
  v9 = v4 + 2;
  v10 = v4 + 14;
  v11 = v9 >> 1;
  if( OutputPath && *(_DWORD *)OutputPathLength >= v10 )
  {
    OutputPath->Version = 1;
    FilePath = OutputPath->FilePath;
    OutputPath->Length = v10;
    OutputPath->Type = 3;
    v13 = v11;
    wcscpy_s((PWCHAR)OutputPath->FilePath, v11, pDeviceNameString->Buffer);
    v14 = (wchar_t *)&FilePath[pDeviceNameString->Length + 2];
    if( pPathName )
      wcscpy_s(v14, v13, pPathName);
    else
      *v14 = 0;
    *(_DWORD *)OutputPathLength = v10;
    return 0;
  }
  else
  {
    *(_DWORD *)OutputPathLength = v10;
    return -1073741789;
  }
}

Referenced by:

ExpConvertArcName
ExpConvertSignatureName
ExpTranslateEfiPath