Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vtbls for IWeakReferenceSource and IWeakReference. #1300

Closed
wants to merge 3 commits into from

Conversation

jlaanstra
Copy link
Collaborator

@jlaanstra jlaanstra commented Mar 14, 2023

Fixes ADO#41937903

When resolving an IWeakReference from a different context, we resolve as IUnknown and then assume that Resolve is the next method in the vtbl, see

ExceptionHelpers.ThrowExceptionForHR((*(delegate* unmanaged[Stdcall]<IntPtr, Guid*, IntPtr*, int>**)ThisPtr)[3](ThisPtr, &riid, &objRef));
. This turns out to not be true and we end up calling an unrelated COM interface with incorrect parameters that than tries to allocate a very large array on the stack resulting in stack overflow.

@jlaanstra
Copy link
Collaborator Author

Superseded by #1301. Thanks @manodasanW

@jlaanstra jlaanstra closed this Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant