On Wed Jun 18 12:45:24 2025 +0000, Hans Leidekker wrote:
IUnknown is not accepted by midlrt but if I use an IInspectable parameter and pass an empty metadata dir I get an error: Could not load required metadata file. If I copy system windows.foundation.winmd to that directory the idl file compiles successfully. So it does appear to use that directory to resolve IInspectable at least.
It looks like WinRT interface are simply not allowed to use anything that isn't a WinRT type. Trying to pass types from the global namespace usually fails a the IDL parsing time.
Then it seems like that EventRegistrationToken is allowed, but it also doesn't show up from `Windows.Foundation` assembly or namespace in ILSpy. Its namespace is `System.Runtime.InteropServices.WindowsRuntime`, its resolution scope is 0 and and its assembly ref seems special:
 