On 30.12.2016 19:18, LRN wrote:
> 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.
> 
> 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. 

After extensive googling i've found the RoGetMetaDataFile() function[1], which
can be given class name to obtain a COM object that implements IMetaDataImport2
interface[2][3]. According to this SO question[4], it is possible to use
IMetaDataImport to obtain the alternative names for overloaded functions (and
everything else that we might need to write an IDL).


[1] 
https://msdn.microsoft.com/en-us/library/windows/desktop/br229856(v=vs.85).aspx

[2] 
https://msdn.microsoft.com/en-us/library/windows/desktop/hh870577(v=vs.85).aspx

[3] 
https://msdn.microsoft.com/en-us/library/windows/desktop/hh870578(v=vs.85).aspx

[4]
https://stackoverflow.com/questions/12901855/winrt-idl-overload-reflection-through-imetadataimport

-- 
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