-
Notifications
You must be signed in to change notification settings - Fork 998
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 RCW for IDataObject #7519
Add RCW for IDataObject #7519
Conversation
Or better, I should just finish #7087 |
Thank you. However, the biggest qestion here is how we test this? And ensure we haven't missed anything else...
We're in RC1 and the runway is too small for any significant changes, and risks are too great |
I can help test this, possibly. It needs to be an end to end test like the drag & drop tests in If I knew how to get the coordinates of a file located on the screen, I could write the test. |
I thin we need something more complicated then |
Basically less risky change would be undo these 2 changes in this file https://github.com/dotnet/winforms/pull/6976/files#diff-efdc83ac4513276157401c19a46f9c20f7c2aa84d9b9eb1cd19f37aca86420d5R33 |
It's possible to open an new instance of Explorer and select a file in it, e.g. Files in Windows Explorer are displayed in a ListView control, so each file/folder is just a listview item. Accessibility tools (e.g., Narrator, etc.) can work it out, so we should be able too. Perhaps this could help https://docs.microsoft.com/windows/win32/winauto/uiauto-clientportal and https://docs.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomation-getfocusedelement Pinging @vladimir-krestov for ideas. |
Thank you. I'm still trying to answer the question of how we can reliably find the screen coordinates of that file, but for the record, I can reproduce the issue in a |
A manual test that already exists and reproduces this issue is in |
I will test these changes. |
IDataObjectVtbl.STGMEDIUM_Raw mediumRaw; | ||
((delegate* unmanaged<IntPtr, FORMATETC*, IDataObjectVtbl.STGMEDIUM_Raw*, HRESULT>)(*(*(void***)_wrappedInstance + 3))) | ||
(_wrappedInstance, pFormat, &mediumRaw).ThrowIfFailed(); | ||
medium.pUnkForRelease = Marshal.GetObjectForIUnknown(mediumRaw.pUnkForRelease); |
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.
What if pUnk
is Zero
here? I'm seeing an ArgumentNullException
in my initial tests.
@kant2002 the team has chatted and we think it's probably for the best that we do as you suggest here for .NET 7, and we take the completed fix in .NET 8 with the additional testing. Does that work for you? |
Yes. I think so too. I think smallest thing to undo would be just 2 lines but if you think whole PR should be undone I'm fine. We should have stable WinForms a priority |
if we do not have any other known scenario regressed and this reported scenario is fixed by undoing those two lines, we should stick to those lines in this and monitor for any new reports. Meanwhile, I will ask our test team to run some drag/drop scenarios to see if there are any pri0 scenarios that need to be addressed? |
@kant2002 tested this PR using 2 sample projects, the issue still repro. Please take a look, thanks. |
@kant2002 , did you get a chance to look latest comments here? |
Would you be able to action this? The window for RC1 is closing fast. |
If only undo, I can do that. |
@kant2002 , would it be possible to make the requested changes here before coming Monday? |
Fixes dotnet#7518 Eventually I should improve dotnet#7519 but until then, this is safer approach IMO. cc @Olina-Zhang @dreddy-work @RussKie
@RussKie - I now know how to write the automated test, dragging from Explorer, using |
You're giving me too much credit. I randomly blurbed something and you did all the work :) And now I'm eager to learn how to do that, you'll have to show us a test. |
I mean all of your help so far, you are like a code whisperer. I'm unsure how to proceed with the test, should I create a separate issue? |
Yes please. |
The current status of this "draft" PR has persisted for over 180 days, making it highly probable that it is no longer aligned with the latest codebase. Our repository is set up to automatically close draft PRs that have become outdated, and it requests the author to revisit and reopen them if they deem it necessary, thereby bringing them to the team's attention. |
Fixes #7518
Microsoft Reviewers: Open in CodeFlow