-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Description
Using ControlFlowGuard when creating a native dll that uses CsWinRT (which generates the DllGetActivationFactory and DllCanUnloadNow native exports) and publishing that as AOT creates a dll with DllCanUnloadNow not in the icall table. This causes an external caller of DllCanUnloadNow (in my case, combase.dll since this is part of implementing the WinRT contract) to failfast with FAST_FAIL_GUARD_ICALL_CHECK_FAILURE.
Reproduction Steps
Minimal repro project with repro steps in readme:
https://github.com/jevansaks/NAOTControlFlowGuardRepro/tree/main
Expected behavior
All exports of the dll should be in the CFG table since they're designed to be called virtually.
Actual behavior
DllGetActivationFactory export is in the CFG table but DllCanUnloadNow is not.
Regression?
I don't know. Probably not a regression.
Known Workarounds
No response
Configuration
.NET 8, running on Windows 11, compiling for windows-x64 native. I didn't try any other windows native targets.
Other information
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status