[webkit-dev] Windows IDL interoperability with non-C languages

Ashod Nakashian ashodnakashian at yahoo.com
Mon Mar 12 05:31:15 PDT 2012

IDL/Windows Webkittens,

The Windows IDLs utilizes many Windows HANDLE types in their members. These handles are defined as void*, which is an opaque type. This is fine until one tries to import the WebKit COM into VB or a .Net environment only to discover that these handles are wrapped (read: replaced) with _RemotableHandle. The problem is that this makes WebKit COM practically unusable without a lot of plumbing to get around this RemotableHandle type.

A possible solution is to avoid using void* for these handles. There is a "standardized" way to do that, and that's to declare _MIDL_DECLARE_WIREM_HANDLE when invoking MIDL (the IDL compiler) and redefine the Windows handles as integrals[1]. I've already filed a bug[2] and submitted a patch with the workaround.

This works great, at least in .Net. The main concern here is whether this change will break any C/C++ COM consumers. All EWS servers are happy with the patch. Someone more experienced in COM/WebKit might be able to give more insight and hopefully confirm or disprove the incompatibility concerns.

[1] Here is one reference use of this workaround: http://miranda-gds-v2.googlecode.com/svn/trunk/common/GoogleDesktopDisplayAPI.idl
[2] https://bugs.webkit.org/show_bug.cgi?id=80751

Thanks in advance,

More information about the webkit-dev mailing list