How does GetLauncherName work?
```cpp
//----- (00000001800507F0) ----------------------------------------------------
__int64 __fastcall CTaskGroup::GetTitleText(CTaskGroup* this,
                                            struct ITaskItem* a2,
                                            unsigned __int16* a3,
                                            int a4) {
  __int64 v4;               // rbp
  _QWORD* v8;               // rbx
  signed int LauncherName;  // ecx
  __int64 v10;              // rdx
  __int64 v11;              // r8
  unsigned __int16 v12;     // ax
  unsigned __int16* v13;    // rax
  __int64 v15;              // rdi
  __int64(__fastcall * v16)(__int64, __int64, unsigned __int16*,
                            _QWORD);  // rbx
  __int64 v17;                        // rax
  int v18;                            // eax

  v4 = a4;
  if (a2) {
    if ((*(unsigned __int8(__fastcall**)(struct ITaskItem*))(*(_QWORD*)a2 +
                                                             472LL))(a2)) {
      return (unsigned int)(*(__int64(__fastcall**)(
          struct ITaskItem*, unsigned __int16*, _QWORD, _QWORD))(
          *(_QWORD*)a2 + 512LL))(a2, a3, (unsigned int)v4, 0LL);
    } else {
      v15 = *((_QWORD*)this + 15);
      v16 = *(__int64(__fastcall**)(__int64, __int64, unsigned __int16*,
                                    _QWORD))(*(_QWORD*)v15 + 104LL);
      v17 = (*(__int64(__fastcall**)(struct ITaskItem*))(*(_QWORD*)a2 + 96LL))(
          a2);
      v18 = v16(v15, v17, a3, (unsigned int)v4);
      LauncherName = -2147467259;
      if (v18 > 0)
        return 0;
    }
  } else {
    v8 = (_QWORD*)((char*)this + 16);
    if (*((_QWORD*)this + 2) ||
        (LauncherName = CTaskGroup::GetLauncherName(this, (LPWSTR*)this + 2),
         LauncherName >= 0)) {
      v10 = v4;
      if ((unsigned __int64)(v4 - 1) > 0x7FFFFFFE) {
        LauncherName = -2147024809;
        if ((_DWORD)v4)
          *a3 = 0;
      } else {
        v11 = *v8 - (_QWORD)a3;
        do {
          if (!(2147483646 - v4 + v10))
            break;
          v12 = *(unsigned __int16*)((char*)a3 + v11);
          if (!v12)
            break;
          *a3++ = v12;
          --v10;
        } while (v10);
        v13 = a3 - 1;
        if (v10)
          v13 = a3;
        LauncherName = v10 == 0 ? 0x8007007A : 0;
        *v13 = 0;
      }
    }
  }
  return (unsigned int)LauncherName;
}
// 1801AE010: using guessed type __int64 __fastcall
// guard_dispatch_icall_thunk_10345483385596137414();

//----- (0000000180050940) ----------------------------------------------------
__int64 __fastcall CTaskGroup::GetLauncherName(CTaskGroup* this,
                                               LPWSTR* ppwsz) {
  HRESULT v4;            // ebx
  const WCHAR* v5;       // rcx
  int v6;                // eax
  const ITEMIDLIST* v7;  // rcx
  int v8;                // r14d
  int* v9;               // rax
  __int64(__fastcall * v10)(void*, __int64, _QWORD, _QWORD, _QWORD, PCWSTR*,
                            _QWORD);                                  // rbx
  __int64 v11;                                                        // rcx
  __int64 v12;                                                        // rax
  _WORD* v14;                                                         // rax
  __int64 v15;                                                        // rdx
  __int64 v16;                                                        // rdi
  unsigned int(__fastcall * v17)(__int64, __int64, WCHAR*, __int64);  // rbx
  __int64 v18;                                                        // rax
  BOOL IsNetworkPathW;                                                // eax
  const WCHAR* v20;                                                   // rcx
  HRESULT StringW;                                                    // eax
  char* FileNameW;                                                    // rax
  void* ppv;             // [rsp+40h] [rbp-C0h] BYREF
  PCWSTR pszSource;      // [rsp+48h] [rbp-B8h] BYREF
  WCHAR pszStr2[16];     // [rsp+50h] [rbp-B0h] BYREF
  WCHAR pszOutBuf[264];  // [rsp+70h] [rbp-90h] BYREF

  *ppwsz = 0LL;
  v4 = 0;
  if (!*((_QWORD*)this + 6))
    goto LABEL_8;
  v5 = (const WCHAR*)*((_QWORD*)this + 1);
  wcscpy(pszStr2, L"search-ms:");
  v6 = StrCmpNICW(v5, pszStr2, 10);
  v7 = (const ITEMIDLIST*)*((_QWORD*)this + 6);
  ppv = 0LL;
  v8 = v6;
  v4 = SHCreateItemFromIDList(v7, &GUID_43826d1e_e718_42ee_bc55_a1e261c37bfe,
                              &ppv);
  if (v4 >= 0) {
    LODWORD(pszSource) = 0;
    v4 = (*(__int64(__fastcall**)(void*, __int64, PCWSTR*))(
        *(_QWORD*)ppv + 48LL))(ppv, 0x10000LL, &pszSource);
    if (v4 >= 0 && ((unsigned int)pszSource & 0x10000) != 0 ||
        (unsigned __int8)CTaskGroup::IsImmersiveGroup(this) || !v8) {
      v4 = (*(__int64(__fastcall**)(void*, __int64, LPWSTR*))(
          *(_QWORD*)ppv + 40LL))(ppv, 2148007937LL, ppwsz);
    }
    (*(void(__fastcall**)(void*))(*(_QWORD*)ppv + 16LL))(ppv);
    if (v4 >= 0 && !*ppwsz) {
    LABEL_8:
      v9 = (int*)*((_QWORD*)this + 4);
      if (v9) {
        if (*v9 > 0) {
          ppv = 0LL;
          v4 = CoCreateInstance(&CLSID_StartMenuCacheAndAppResolver, 0LL, 3u,
                                &GUID_de25675a_72de_44b4_9373_05170450c140,
                                &ppv);
          if (v4 < 0)
            return (unsigned int)v4;
          pszSource = 0LL;
          v10 = *(__int64(__fastcall**)(void*, __int64, _QWORD, _QWORD, _QWORD,
                                        PCWSTR*, _QWORD))(*(_QWORD*)ppv + 96LL);
          v11 = **(_QWORD**)(*((_QWORD*)this + 4) + 8LL);
          v12 = (*(__int64(__fastcall**)(__int64))(*(_QWORD*)v11 + 96LL))(v11);
          v4 = v10(ppv, v12, 0LL, 0LL, 0LL, &pszSource, 0LL);
          if (v4 >= 0 && pszSource) {
            if (SHLoadIndirectString(pszSource, pszOutBuf, 0x104u, 0LL) >= 0)
              v4 = SHStrDupW(pszOutBuf, ppwsz);
            CoTaskMemFree((LPVOID)pszSource);
          }
          (*(void(__fastcall**)(void*))(*(_QWORD*)ppv + 16LL))(ppv);
        }
        if (v4 < 0)
          return (unsigned int)v4;
      }
      if (!*ppwsz) {
        v14 = (_WORD*)*((_QWORD*)this + 8);
        if (v14 && *v14 == 42 && (v15 = *((_QWORD*)this + 4)) != 0 &&
            *(int*)v15 > 0) {
          v16 = *((_QWORD*)this + 15);
          v17 = *(unsigned int(__fastcall**)(__int64, __int64, WCHAR*,
                                             __int64))(*(_QWORD*)v16 + 104LL);
          v18 = (*(__int64(__fastcall**)(_QWORD))(***(_QWORD***)(v15 + 8) +
                                                  96LL))(**(_QWORD**)(v15 + 8));
          v4 = v17(v16, v18, pszOutBuf, 260LL) == 0 ? 0x80004005 : 0;
        } else {
          IsNetworkPathW = PathIsNetworkPathW(*((LPCWSTR*)this + 1));
          v20 = (const WCHAR*)*((_QWORD*)this + 1);
          if (IsNetworkPathW) {
            FileNameW = (char*)PathFindFileNameW(v20);
            StringW = StringCchCopyW((char*)pszOutBuf, 260LL, FileNameW);
          } else {
            LODWORD(pszSource) = 260;
            StringW = AssocQueryStringW(0x42u, ASSOCSTR_FRIENDLYAPPNAME, v20,
                                        0LL, pszOutBuf, (DWORD*)&pszSource);
          }
          v4 = StringW;
        }
        if (v4 >= 0)
          return (unsigned int)SHStrDupW(pszOutBuf, ppwsz);
      }
    }
  }
  return (unsigned int)v4;
}
```