On Monday, 19 December 2016 at 22:47:26 UTC, kinke wrote:
On Monday, 19 December 2016 at 09:49:13 UTC, kinke wrote:
[...]

I did some research myself and indeed, COM classes/interfaces are apparently subject to a separate ABI. Unfortunately, googling it hasn't turned up any official (and not even some inofficial) documentation so far. Based on the first few tests on Win64, integers are returned in RAX, floats (and I guess doubles too) in XMM0, and structs (incl. 2x int32 and 2x float) via hidden sret pointer, with `this` pointer in RCX (1st arg) and `sret` in RDX (2nd arg). Compared to the normal Win64 C++ ABI it just seems more conservative by always returning structs via hidden pointer.

Wow! That was quick. Such tests would take me few days.

I'm not sure how it may help but there is "specs" in MS .net core runtime, just search the repo for COM

like this https://github.com/dotnet/coreclr/blob/32f0f9721afb584b4a14d69135bea7ddc129f755/src/vm/amd64/GenericComCallStubs.asm#L177

Reply via email to