Skip to content

cleanup: remove invalid m_deviceHostSupport checks#13787

Merged
benhillis merged 1 commit into
masterfrom
user/benhill/m_deviceHostSupport_checks
Nov 26, 2025
Merged

cleanup: remove invalid m_deviceHostSupport checks#13787
benhillis merged 1 commit into
masterfrom
user/benhill/m_deviceHostSupport_checks

Conversation

@benhillis

Copy link
Copy Markdown
Member

This member variable is always guaranteed to be set (because it is set in the constructor).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR cleans up unnecessary null checks for the m_deviceHostSupport member variable in GuestDeviceManager. Since this variable is initialized in the constructor using wil::MakeOrThrow<DeviceHostProxy>(), which throws on failure rather than returning nullptr, the object is guaranteed to be valid for the lifetime of the GuestDeviceManager instance.

  • Removes defensive THROW_HR_IF(E_NOT_VALID_STATE, !m_deviceHostSupport) checks from three methods
  • Simplifies Shutdown() by removing conditional check and directly calling the method

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@benhillis benhillis enabled auto-merge (squash) November 26, 2025 03:34
@benhillis benhillis merged commit ba90ee1 into master Nov 26, 2025
12 checks passed
@benhillis benhillis deleted the user/benhill/m_deviceHostSupport_checks branch April 23, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants