8000 Cleanup COM interfaces in jump list code - fix PreserveSig attributes by weltkante · Pull Request #9899 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@weltkante
Copy link
Contributor

PR Summary

Correction of wrong/unnecessary COM interop attributes

PR Context

While reviewing the JumpList COM interop code for #9295 I noticed that several [PreserveSig] attributes were wrong. The methods which got the attribute wrong were never called, so this is not a direct fix for the issue, its just to prevent future problems should they ever be called.

Also there were some unnecessary [MethodImpl] attributes which are not supposed to be there, these are cleaned up.

PR Checklist

@daxian-dbw
Copy link
Member

Close and reopen the PR to force Windows CI build working properly.

@daxian-dbw daxian-dbw closed this Jun 17, 2019
@daxian-dbw daxian-dbw reopened this Jun 17, 2019
@TravisEz13 TravisEz13 closed this Oct 5, 2019
@TravisEz13 TravisEz13 reopened this Oct 5, 2019
@daxian-dbw daxian-dbw added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Oct 7, 2019
@daxian-dbw
Copy link
Member

@bergmeister Can you please review this PR?

Copy link
Contributor
@bergmeister bergmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot comment much on the code change itself as I am not a COM expert (maybe you guys could ask someone from the .Net team?), so I cannot say if it makes it better or worse, we could trust the author but the PS team has to decide on the risk of changing something when there hasn't been reported issues (since we fixed the original problem by using an STA thread, I haven't heard about problems with the JumpLIst since then). I appreciate the author's good intentions but there is a chance that this is a change that could cause a regression in edge cases or less common scenarios like old OSs, especially since we do not have test automation for this feature.
I have tested manually though that the functionality still works on Win 10 (1809) (one needs to make sure to build PowerShell from a folder where the JumpList has never been created before due to persistence).
I therefore leave the decision up to the PowerShell team and want to stay neutral on this.

@anmenaga
Copy link
anmenaga commented Oct 11, 2019

Looking at the docs, this change seems fine.
@SteveL-MSFT what is your opinion on this?

@SteveL-MSFT
Copy link
Member

@anmenaga based on the docs, it would seem this is correct. Can we get the CodeFactor issue fixed?

@weltkante
Copy link
Contributor Author
weltkante commented Oct 11, 2019

@SteveL-MSFT do I insert newlines for the whole file or only the line it complains about? there are plenty more methods without separating newlines in this file, I think it only complains on the lines I touched.

@SteveL-MSFT
Copy link
Member

@weltkante only the line it is complaining about. Thanks!

(General style issues in the file should be a seperate PR, but I'm not asking for you to do that unless you want to :)

@weltkante weltkante force-pushed the interop-fix branch 4 times, most recently from b2b0d26 to cba8116 Compare October 12, 2019 07:26
@weltkante
Copy link
Contributor Author

Very sorry for the noise, got my repo settings wrong and had to amend. Build failure seems independent?

@SteveL-MSFT
Copy link
Member

@PoshChan please retry windows

@PoshChan
Copy link
Collaborator

@SteveL-MSFT, successfully started retry of PowerShell-CI-Windows

@SteveL-MSFT
Copy link
Member

@weltkante the static analysis failures are understood and should not block this PR

@anmenaga
Copy link

Looks like the general consensus is to merge this PR.
Test failure in PowerShell-CI-windows is unrelated TestAppDomainProcessExitEvenHandlerNotLeaking failure that @daxian-dbw is fixing separately.

@anmenaga anmenaga changed the title Fix PreserveSig attributes Cleanup COM interfaces in jump list code - fix PreserveSig attributes Oct 15, 2019
@anmenaga anmenaga merged commit 8b68a4c into PowerShell:master Oct 15, 2019
@ghost
Copy link
ghost commented Oct 23, 2019

🎉v7.0.0-preview.5 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

0