Recently i've been thinking of using WinRT in C applications (GTK+, to be
specific). This is possible, because WinRT has COM interface, and COM is usable
(with some verbosity) in C.

Thing is, we need C headers for that. These could be written by hand or
generated from idl files, and idl files could be written by hand or generated
from reading WinRT metadata.

I've considered the written-by-hand route, and it's tiresome. Methods often use
objects of other classes as arguments, which expands total number of classes
one needs to describe to do something useful. Also, documentation is scarce
(MSDN documents WinRT itself, but not its COM underbelly).

Using metadata seems like a more rational route, and it's possible too, because
WinRT is CLI-compatible, and exposes CLI metadata. We just need to be able to
read it.

I was able to successfully get some of that information from winmd files that
come with the OS by using the monodis program from Mono, but apart from some
weirdness (like not being able to load other assemblies; it's probably due to
me not using it correctly), and version mismatches, it fails to find one
crucial bit of information - names for overloaded functions.

For example, Windows.UI.Core.CoreDispatcher has two methods: ShouldYield and
ShouldYield. Name's the same. The difference is that first one takes no extra
arguments, while second one gets an argument of type
Windows.UI.Core.CoreDispatcherPriority.

In C, since it does not supports overloads, these two must have different
names. Peeking at MS SDK idl files (or just grepping through Windows binaries)
gives us the names - ShouldYield and ShouldYieldToPriority. Note that
ShouldYieldToPriority is not documented anywhere (and gives almost literally
zero results in Google), and is only ever mentioned in winmd files (and MS SDK,
of course).

So the first obstacle, i think, is to somehow make mono disassembler able to
find these names for these overloaded functions in metadata files. Do we have
any contacts with Mono or Cecil (the library that Mono uses to inspect
metadata, AFAIU) developers?

-- 
O< ascii ribbon - stop html email! - www.asciiribbon.org

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to