Skip to content

Conversation

@toribioa
Copy link
Member

Description

Enable hotpatching capabilities for msquic.dll in Release|x64 builds. To produce MSQuic artifacts with runtime hotpatching support enabled across both SChannel and OpenSSL binaries.

  • Enables function padding for Release|x64 configuration
  • Supports runtime hotpatching for production deployments
  • Applied to both SChannel and OpenSSL build paths

These linker flags modifications meaning:

  • /hotpatchcompatible /profile /incremental:no This adds records to the PDB which lets vulcan understand the binary.
  • /FUNCTIONPADMIN:6 This adds padding needed for hotpatching on x64 binaries. The 6 bytes of padding on x64 are used by hpiload at patch load time to trampoline from the baseline binary to the patch binary.

Key points:

  • Project Generation Impact: Modifies CMakeLists.txt to generate Visual Studio project files with conditional hotpatch support
  • Dual Binary Coverage: Applied uniformly to both SChannel (build/windows/x64_schannel/) and OpenSSL (build/windows/x64_openssl/) project generation paths
  • Configuration Specificity: Hotpatch flags integrated exclusively into Release|x64 configuration within generated .vcxproj files
  • Build System Integration: Leverages CMake's CMAKE_SHARED_LINKER_FLAGS_RELEASE to ensure consistent flag application across binaries
  • CI/CD Compatibility: Source-controlled approach enables automatic project generation with hotpatch support in GitHub CI pipelines
  • Production Targeting: Conditional logic ensures hotpatch overhead limited to production Release x64 builds

Generated project paths:

  • SChannel Build Path: build/windows/x64_schannel/src/bin/msquic.vcxproj
  • OpenSSL Build Path: build/windows/x64_openssl/src/bin/msquic.vcxproj

Testing

Completed Verification
✅ Visual Studio Build: Confirmed that locally built msquic.dll for x64 Release configuration contains all required hotpatch prerequisites for SChannel and OpenSSL binaries.
⏳ Hotpatch Loading: Successfully loaded and applied a hotpatch to the driver in memory during testing.

⏳ GitHub Actions Pipeline: Verify that CI/CD-generated msquic.dll artifacts maintain hotpatch compatibility
⏳ Release Artifact Testing: Confirm that market-ready msquic.dll binaries produced by GitHub pipelines support hotpatch operations

Validation Plan

Download Release-winuser-windows-2022-x64-schannel artifact from GitHub Actions
Download Release-winuser-windows-2022-x64-openssl artifact from GitHub Actions
Verify binaries contains required function padding and hotpatch metadata
Perform runtime hotpatch loading test with CI-generated binaries

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.

Enable hotpatching capabilities for msquic.dll in Release|x64 builds. To produce MSQuic artifacts with runtime hotpatching support enabled across both SChannel and OpenSSL binaries.

- Enables function padding for Release|x64 configuration
- Supports runtime hotpatching for production deployments
- Applied to both SChannel and OpenSSL build paths

These linker flags modifications meaning:
- /hotpatchcompatible /profile /incremental:no This adds records to the PDB which lets vulcan understand the binary.
- /FUNCTIONPADMIN:6 This adds padding needed for hotpatching on x64 binaries. The 6 bytes of padding on x64 are used by hpiload at patch load time to trampoline from the baseline binary to the patch binary.

Key points:
- Project Generation Impact: Modifies CMakeLists.txt to generate Visual Studio project files with conditional hotpatch support
- Dual Binary Coverage: Applied uniformly to both SChannel (build/windows/x64_schannel/) and OpenSSL (build/windows/x64_openssl/) project generation paths
- Configuration Specificity: Hotpatch flags integrated exclusively into Release|x64 configuration within generated .vcxproj files
- Build System Integration: Leverages CMake's CMAKE_SHARED_LINKER_FLAGS_RELEASE to ensure consistent flag application across binary variants
- CI/CD Compatibility: Source-controlled approach enables automatic project generation with hotpatch support in GitHub CI pipelines
- Production Targeting: Conditional logic ensures hotpatch overhead limited to production Release x64 builds

Generated project paths:
- SChannel Build Path: build/windows/x64_schannel/src/bin/msquic.vcxproj
- OpenSSL Build Path: build/windows/x64_openssl/src/bin/msquic.vcxproj
@codecov
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.24%. Comparing base (ca5c05f) to head (89c5a16).
⚠️ Report is 55 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5441      +/-   ##
==========================================
- Coverage   85.90%   85.24%   -0.67%     
==========================================
  Files          59       59              
  Lines       18600    18600              
==========================================
- Hits        15979    15856     -123     
- Misses       2621     2744     +123     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants