Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

struct HRESULT incompatible with int HRESULT across ABI boundary #3

Open
DefaultRyan opened this issue Jan 21, 2021 · 1 comment
Open
Assignees

Comments

@DefaultRyan
Copy link
Member

The current code is using the metadata struct HRESULT out of the box across the ABI. Unfortunately, unlike function params, structs are not handled the same way at the ABI as integers, so frame/register corruption is occurring.

For a short-term fix, replace the HRESULT struct with the integral value at the ABI.

Long-term, we'll need to figure out what the projected types vs ABI types look like. The type system for Win32 is far less constrained than the WinRT type system, and the lack of conventions and rules presents some additional challenges for just how much we can encapsulate projection logic.

@DefaultRyan DefaultRyan self-assigned this Jan 21, 2021
@tannergooding
Copy link
Member

This is similar to what I called out on CsWin32: microsoft/CsWin32#51

In particular, this is known to be problematic return types on C++ instance methods (like for COM/DirectX methods). There may of course be other scenarios, including future ones, that exist as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants