WinRTAct.dll from Microsoft.WindowsPackageManager.ComInterop NuGet Package crashes with Access Violation when RegFreeWinRT is used #4377
Labels
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Brief description of your issue
Using the module winrtact.dll to create WindowsPackageManager instances from an elevated process crashes if the executable uses RegFreeWinRT.
This makes it impossible to use the WinGet COM api from any elevated desktop (non-packaged) process that does use Register-Free WinRT (such as unpackaged self-contained app sdk projects and c++ Desktop Projects using WinRT APIs).
Event Viewer crash:
Steps to reproduce
Two possible options to reproduce the bug:
Create a C#/WinUI3/AppSdk project and set the project to run unpackaged and AppSdk to be self-contained. Run the process elevated and attempt to create a WindowsPackageManager instance through winrtact.dll (WinGetServerManualActivation_CreateInstance). App will immediately hang and crash.
Event viewer will report a crash on winrtact.dll
0xc0000005
Create a C++ console app and enable WinRT APIs from project properties. Import winrtact.dll thorugh and attempt to create a WindowsPackageManager instance with WinGetServerManualActivation_CreateInstance. App will immediately crash and exit with exit code
0xc0000005
. Example code below:Expected behavior
Instances get created and the api is usable
Actual behavior
Crashes with
0xC0000005
Environment
The text was updated successfully, but these errors were encountered: