You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test host for in-proc COM module validation (microsoft#5910)
Fixesmicrosoft#5869 and microsoft#5870 in the current code and will be backported to 1.12
## Change
Adds a test host that leverages the in-proc COM module (as built
locally) to validate various lifetime management scenarios. It has
numerous options for controlling the scenarios, as well as an extensible
model for adding different tests in the future.
It was able to hit the faults described in the linked issues, and the
fixes are included:
- Move the `ServerShutdownSynchronization` to integrate with the signal
monitoring directly, rather than registering as an object. This also
means that there is no need to unregister, preventing the construction
of a `TerminationSignalHandler`.
- Remove the call that terminates COM objects from the
`DLL_PROCESS_DETACH` handler. If the caller is using the module properly
via COM, the `DllCanUnloadNow` calls should take care of things. If the
process is exiting without that call, leaking objects will be fine (the
caller didn't uninitialize COM, so it is doubtful they care about a
clean exit).
Additionally, these changes were made to support additional scenarios:
- Add the WinRT type names to the manifest file so that WinRT activation
can work.
- Fix the activation factories to be counted objects for the module.
- Add a setting that allows the caller to prevent `DllCanUnloadNow` from
checking the object state, always returning that it cannot unload now.
This can be used to prevent the module from being unloaded (and any
active static objects alive) even if no external objects are active.
0 commit comments