Trim DelayLoadDLLs to DLLs actually imported (fix LNK4199)#3619
Open
dimension-zero wants to merge 1 commit into
Open
Trim DelayLoadDLLs to DLLs actually imported (fix LNK4199)#3619dimension-zero wants to merge 1 commit into
dimension-zero wants to merge 1 commit into
Conversation
Both Ventoy2Disk.vcxproj and VentoyPlugson.vcxproj listed 10 DLLs in
<DelayLoadDLLs>, but the code only actually delay-loads a subset. MSVC
emits LNK4199 for each name on the list that the linker can't find an
import for ("delay-loaded DLL X had no imports").
Reduced to the DLLs that are genuinely imported:
Ventoy2Disk: gdi32.dll;advapi32.dll;shell32.dll;ole32.dll
VentoyPlugson: shell32.dll;ole32.dll
This eliminates 14 LNK4199 warnings across the Win32/x64 Release builds
of both projects, with no runtime change — the dropped DLLs were never
being loaded delayed because they weren't imported in the first place.
Affects 8 ItemDefinitionGroup blocks in Ventoy2Disk.vcxproj (Win32/Arm/
Arm64/x64 × Debug/Release) and 4 in VentoyPlugson.vcxproj.
323b0ed to
ff1a4a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Both `Ventoy2Disk.vcxproj` and `VentoyPlugson.vcxproj` list 10 DLLs in ``, but the code only actually delay-loads a subset. MSVC emits LNK4199 for each name on the list that the linker can't find an import for ("delay-loaded DLL X had no imports").
Trims the list to the DLLs that are genuinely imported in each project:
Impact
Files touched
Stats
Test plan