Skip to content

Conversation

@jkoritzinsky
Copy link
Member

When running on Windows, we are now always running on Win8.

We also don't need to delay-load the WinRT APIs used by CoreCLR anymore as they're always available.

We can also remove the delay loading for version.dll now that we pass /DEPENDENTLOADFLAG:0x800 to force dependencies to be loaded from System32 (the original reason for the delay load hook was to force System32 instead of the default lookup rules for the commonly named version.dll).

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

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 removes Windows 7 compatibility code from CoreCLR, reflecting that the minimum supported version is now Windows 8 or later. The changes streamline the codebase by removing version detection logic, eliminating delay-load infrastructure for WinRT APIs, and simplifying WinRT initialization code.

Key changes:

  • Removes the delay-load hook mechanism and associated delay-load directives for WinRT and version.dll, as these APIs are now always available
  • Eliminates OS version detection code that checked for Windows 7 vs Windows 8
  • Removes WinRT support checks since WinRT is now assumed to be available on all supported platforms

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/native/libs/Common/delayloadhook_windows.cpp Complete removal of delay-load security hook used to force System32 search path for delay-loaded DLLs
src/native/corehost/apphost/static/CMakeLists.txt Removes delay-load directives for WinRT API and version.dll, removes delayloadhook reference and delayimp.lib dependency, fixes trailing whitespace
src/coreclr/vm/threads.cpp Removes WinRTSupported() assertions since WinRT is now always available, updates comments to reflect this
src/coreclr/utilcode/util_nodependencies.cpp Removes InitRunningOnVersionStatus() function and gRunningOnStatus global variable used for OS version detection
src/coreclr/inc/ostype.h Removes RunningOnStatusEnum, gRunningOnStatus, InitRunningOnVersionStatus(), RunningOnWin8(), and WinRTSupported() declarations
src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt Removes delay-load directives for WinRT and version.dll, removes delayimp.lib dependency
src/coreclr/dlls/mscoree/CMakeLists.txt Removes delayloadhook_windows.cpp and Native.rc from sources list

@jkotas
Copy link
Member

jkotas commented Jan 6, 2026

Some of this cleanup was done by copilot in #122907

@jkotas jkotas merged commit 841eb85 into dotnet:main Jan 6, 2026
162 of 164 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants