WSLA session updates and CMake code fix

This commit is contained in:
Beena352 2025-12-05 23:37:45 -08:00
parent 12f12c41c2
commit 0bdbc3fe55
3 changed files with 13 additions and 9 deletions

View File

@ -182,6 +182,16 @@ void WSLASession::ConfigureStorage(const WSLA_SESSION_SETTINGS& Settings)
deleteVhdOnFailure.release();
}
const std::wstring& WSLASession::DisplayName() const
{
return m_displayName;
}
ULONG WSLASession::GetId() const noexcept
{
return m_id;
}
void WSLASession::CopyDisplayName(_Out_writes_z_(bufferLength) PWSTR buffer, size_t bufferLength) const
{
THROW_HR_IF(E_BOUNDS, m_displayName.size() + 1 > bufferLength);

View File

@ -27,15 +27,9 @@ public:
~WSLASession();
ULONG GetId() const noexcept
{
return m_id;
}
ULONG GetId() const noexcept;
const std::wstring& GetDisplayName() const noexcept
{
return m_displayName;
}
const std::wstring& DisplayName() const;
void CopyDisplayName(_Out_writes_z_(bufferLength) PWSTR buffer, size_t bufferLength) const;

View File

@ -71,7 +71,7 @@ HRESULT WSLAUserSessionImpl::OpenSessionByName(LPCWSTR DisplayName, IWSLASession
// TODO: Check for duplicate on session creation.
for (auto& e : m_sessions)
{
if (e->GetDisplayName() == DisplayName)
if (e->DisplayName() == DisplayName)
{
THROW_IF_FAILED(e->QueryInterface(__uuidof(IWSLASession), (void**)Session));
return S_OK;