CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Trying to activate a class that doesn't exist from the POV of WinRT.Host.dll would cause subsequent activation request of class that does exist to throw

Open roxk opened this issue 10 months ago • 1 comments

Describe the bug As titled

To Reproduce See the minimal repro here: https://github.com/roxk/CsWinRTHostThrow/tree/main

Essentially, you call DllGetActivationFactory with a bogus name like "A.B", and then call again with a known name. The call with the known name would crash.

Removing the prior call to activate "A.B" and just call DllGetActivationFactory with a known name doesn't crash.

C++/WinRT dll's DllGetActivationFactory doesn't have this problem.

Expected behavior The call to DllGetActivationFactory with a known name doesn't crash, with or without prior call with a bogus name.

Version Info 2.0.7.

Additional context I'm working on dll support for WinUI3XamlPreview. C++/WinRT dll just works. For CsWinRT dll, this bug is a show-stopper.

roxk avatar Apr 08 '24 05:04 roxk

As for the invalid name, does the activation factory call return ERROR_MOD_NOT_FOUND?

dongle-the-gadget avatar Apr 08 '24 18:04 dongle-the-gadget