Skip to content

ComWrappers do not respect interface IID when used for marshalling  #35883

Closed

Description

@jkotas

Activity

  1. Dotnet-GitSync-Bot commented on May 6, 2020

    @Dotnet-GitSync-Bot
    Collaborator

    I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label.

  2. added
    untriaged
    on May 6, 2020
  3. added this to the 5.0 milestone on May 6, 2020
  4. removed
    untriaged
    on May 6, 2020
  5. AaronRobinsonMSFT commented on May 6, 2020

    @AaronRobinsonMSFT
    Member

    As mentioned in the above bug there is an issue at:

    if (TryGetComIPFromObjectRefUsingComWrappers(*poref, &pUnk))
    {
    SafeComHolder<IUnknown> pvObj;
    hr = pUnk->QueryInterface(iid, &pvObj);
    if (FAILED(hr))
    COMPlusThrowHR(hr);
    RETURN pUnk;
    }

    There is also another instance of the same issue lurking higher in the file:

    if (TryGetComIPFromObjectRefUsingComWrappers(*poref, &pUnk))
    {
    hr = S_OK;
    SafeComHolder<IUnknown> pvObj;
    if (ReqIpType & ComIpType_Dispatch)
    {
    hr = pUnk->QueryInterface(IID_IDispatch, &pvObj);
    }
    else if (ReqIpType & ComIpType_Inspectable)
    {
    SafeComHolder<IInspectable> pvObj;
    hr = pUnk->QueryInterface(IID_IInspectable, &pvObj);
    }
    if (FAILED(hr))
    COMPlusThrowHR(hr);
    if (pFetchedIpType != NULL)
    *pFetchedIpType = ReqIpType;
    RETURN pUnk;
    }

  6. ghost locked as resolved and limited conversation to collaborators on Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions