Skip to content

Conversation

@benhillis
Copy link
Member

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

Copy link
Contributor

Copilot AI left a comment

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants