-
Notifications
You must be signed in to change notification settings - Fork 971
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
Fix ILegacyIAccessibleProvider.GetSelection return type #3231
Conversation
src/System.Windows.Forms.Primitives/src/Interop/UiaCore/Interop.ILegacyIAccessibleProvider.cs
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/AccessibleObject.cs
Outdated
Show resolved
Hide resolved
...stem.Windows.Forms.Primitives/src/Interop/UiaCore/Interop.IRawElementProviderHwndOverride.cs
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/AccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/InternalAccessibleObject.cs
Outdated
Show resolved
Hide resolved
612dc66
to
f0bd4c0
Compare
src/System.Windows.Forms.Primitives/src/Interop/UiaCore/Interop.IAccessibleEx.cs
Outdated
Show resolved
Hide resolved
f0bd4c0
to
8c9503c
Compare
8c9503c
to
51139a0
Compare
Codecov Report
@@ Coverage Diff @@
## master #3231 +/- ##
====================================================
- Coverage 66.98140% 35.56798% -31.41342%
====================================================
Files 1342 896 -446
Lines 505621 253239 -252382
Branches 40889 36734 -4155
====================================================
- Hits 338672 90072 -248600
+ Misses 161382 158314 -3068
+ Partials 5567 4853 -714
|
...stem.Windows.Forms.Primitives/src/Interop/UiaCore/Interop.IRawElementProviderHwndOverride.cs
Show resolved
Hide resolved
c50e107
to
db7da17
Compare
db7da17
to
1de4cef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/System.Windows.Forms/src/System/Windows/Forms/AccessibleObject.cs
Outdated
Show resolved
Hide resolved
1de4cef
to
a05cdd4
Compare
@vladimir-krestov please review (keeping in mind #3524 issue). |
Sorry, I'm not good at Marshaling. So I can't say if it was made correctly. @RussKie, I tested Hugh's branch and checked my case (#3524). This is doesn't fix my issue and I need to remove |
Proposed Changes
Running the following test
I get an assertion failure in
Instead of
S_OK
, I getCOR_E_SAFEARRAYTYPEMISMATCH
(0x80131533) returned as the HRESULT.Taking a look at the native definition, we seem to be returning
object[]
instead of an interface array. So I think we end up marshalling an array of variants (?) definitely not the interface!From https://github.com/tpn/winsdk-10/blob/master/Include/10.0.10240.0/um/UIAutomationCore.idl#L845
HRESULT GetSelection ( [out, retval] SAFEARRAY(IRawElementProviderSimple *) * pvarSelectedChildren );
The fix is to correct the return value.
Discussion
Following on from dotnet/runtime#35855, should we create our own
SAFEARRAY
type and somehow pass this in as a pointer?Microsoft Reviewers: Open in CodeFlow