New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 750166 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Review ax_platform_node_win_unittest for non-uses of QueryInterface

Project Member Reported by dougt@chromium.org, Jul 28 2017

Issue description

The standard says that QueryInterface needs to be used when retrieving IAccessible2 from IAccessible.

We should double check the code there and make sure we do this everywhere.  I am landing a CL that is going to break this standards (it should be okay since the object that implements both interfaces is the same).  This crbug is a reminder to fix this up.
 

Comment 1 by dougt@chromium.org, Jul 30 2017

Status: Fixed (was: Assigned)
We use ScopedComPtr in all cases to convert from a IAccessible which is typedef'ed to a Microsoft::WRL::ComPtr<T>.  See:

https://cs.chromium.org/chromium/src/base/win/scoped_comptr.h?rcl=16169b07d2699afd7369f16176cae3447fed5499&l=14


Microsoft::WRL::ComPtr<T> CopyTo is the method which we use to convert from one interface pointer to another type:

https://docs.microsoft.com/en-us/cpp/windows/comptr-copyto-method

Specifically CopyTo has 3 forms and the form we are using does QI the underlying object. IMO, the docs are pretty hard to be sure of this point.  I verified this in the debugger.  When calling CopyTo, you get a stack that looks similar to this (not ethat we're calling into the QI of AXPlatformNodeWin.


>	accessibility.dll!?QueryInterface@?$CComObject@VAXPlatformNodeWin@ui@@@ATL@@WBA@EAAJAEBU_GUID@@PEAPEAX@Z() Line 0	C++
 	accessibility_unittests.exe!Microsoft::WRL::ComPtr<IUnknown>::CopyTo<IAccessibleTable>(IAccessibleTable * * ptr) Line 457	C++
 	accessibility_unittests.exe!ui::AXPlatformNodeWinTest_TestIAccessibleTableGetNSelectedColumnsOne_Test::TestBody() Line 1525	C++


Given all of that -- if we're using ScopedComPtr (which we are), QIs are happening.


Sign in to add a comment