Add linker options for hotpatching on x64 kernel driver #5437
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add hotpatch support for Windows x64 kernel driver
This PR enables runtime hotpatching capabilities for the MSQuic kernel driver (msquic.sys) in Release|x64 builds by adding the necessary linker flags to msquic.kernel.vcxproj.
Background
Currently, production releases of msquic.sys do not support runtime hotpatching due to missing linker options and function padding required for x64 hotpatch operations. This limitation prevents in-memory updates and affects compatibility with components such as SMBDirect that depend on hotpatch-enabled drivers.
Changes
This PR adds the following linker flags to the Release|x64 configuration:
Impact
Technical Details
Testing
Completed Verification
✅ Visual Studio Build: Confirmed that locally built msquic.sys for x64 Release configuration contains all required hotpatch prerequisites.
✅ Hotpatch Loading: Successfully loaded and applied a hotpatch to the driver in memory during testing.
✅ GitHub Actions Pipeline: Verify that CI/CD-generated msquic.sys artifact maintain hotpatch compatibility
✅ Release Artifact Testing: Confirm that market-ready msquic.sys binary produced by GitHub pipelines support hotpatch operations
Validation Plan
✅https://github.com/microsoft/msquic/actions/runs/17618956151/job/50059433726?pr=5437
✅https://github.com/microsoft/msquic/actions/runs/17618956151/artifacts/3976994659
✅Successfully loaded and applied a hotpatch to the driver in memory during testing.
Documentation
No user-facing documentation changes required. This is an internal build configuration change that enables existing Windows hotpatch infrastructure. The functionality is transparent to end users and does not modify MSQuic APIs or behavior.