public void UseExistingHostId()
        {
            using (var procs = NtProcess.GetSessionProcesses(ProcessAccessRights.QueryLimitedInformation).ToDisposableList())
            {
                foreach (var proc in procs)
                {
                    using (var result = NtToken.OpenProcessToken(proc, TokenAccessRights.Query, false))
                    {
                        if (!result.IsSuccess)
                        {
                            continue;
                        }

                        var    token     = result.Result;
                        string packageId = token.PackageFullName.TrimEnd('\0');

                        if (!_packageId.Equals(packageId, StringComparison.OrdinalIgnoreCase))
                        {
                            continue;
                        }

                        var sysappid = token.GetSecurityAttributeByName("WIN://SYSAPPID");
                        var hostid   = token.GetSecurityAttributeByName("WIN://PKGHOSTID");
                        if (hostid == null || sysappid.Values.Count() != 3)
                        {
                            continue;
                        }

                        HostId = hostid.Values.Cast <ulong>().First();
                        return;
                    }
                }
            }

            throw new ArgumentException("Can't find existing host to use for activation");
        }