cleanup: remove invalid m_deviceHostSupport checks (#13787)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

Ben Hillis committed Nov 26, 2025 at 07:59 UTC ba90ee11fa83a1cb7d908d64cb50197afa6a8aeb
1 file changed +1 -7
src/windows/service/exe/GuestDeviceManager.cpp
+1 -7
@@ -52,13 +52,11 @@ GUID GuestDeviceManager::AddHdvShareWithOptions(
52
53 GUID GuestDeviceManager::AddNewDevice(_In_ const GUID& deviceId, _In_ const wil::com_ptr<IPlan9FileSystem>& server, _In_ PCWSTR tag)
54 {
55 - THROW_HR_IF(E_NOT_VALID_STATE, !m_deviceHostSupport);
55 return m_deviceHostSupport->AddNewDevice(deviceId, server, tag);
56 }
57
58 void GuestDeviceManager::AddRemoteFileSystem(_In_ REFCLSID clsid, _In_ PCWSTR tag, _In_ const wil::com_ptr<IPlan9FileSystem>& server)
59 {
61 - THROW_HR_IF(E_NOT_VALID_STATE, !m_deviceHostSupport);
60 m_deviceHostSupport->AddRemoteFileSystem(clsid, tag, server);
61 }
62
@@ -134,16 +132,12 @@ GuestDeviceManager::DirectoryObjectLifetime GuestDeviceManager::CreateSectionObj
132
133 wil::com_ptr<IPlan9FileSystem> GuestDeviceManager::GetRemoteFileSystem(_In_ REFCLSID clsid, _In_ std::wstring_view tag)
134 {
137 - THROW_HR_IF(E_NOT_VALID_STATE, !m_deviceHostSupport);
135 return m_deviceHostSupport->GetRemoteFileSystem(clsid, tag);
136 }
137
138 void GuestDeviceManager::Shutdown()
139 try
140 {
144 - if (m_deviceHostSupport)
145 - {
146 - m_deviceHostSupport->Shutdown();
147 - }
141 + m_deviceHostSupport->Shutdown();
142 }
143 CATCH_LOG()