Skip to content

Cleanup COM interfaces in jump list code - fix PreserveSig attributes - #9899

Merged
Andrew (anmenaga) merged 2 commits into
PowerShell:masterfrom
weltkante:interop-fix
Oct 15, 2019
Merged

Andrew (anmenaga) merged 2 commits into
PowerShell:masterfrom
weltkante:interop-fix

Conversation

@weltkante

Copy link
Copy Markdown
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
Copy Markdown
Member

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

@daxian-dbw Dongbo Wang (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
Copy Markdown
Member

Christoph Bergmeister (@bergmeister) Can you please review this PR?

@bergmeister Christoph Bergmeister (bergmeister) left a comment •

Copy link
Copy Markdown
Contributor

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

Andrew (anmenaga) commented Oct 11, 2019 •

Copy link
Copy Markdown

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

@SteveL-MSFT

Copy link
Copy Markdown
Member

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

@weltkante

Tobias Käs (weltkante) commented Oct 11, 2019 •

Copy link
Copy Markdown
Contributor Author

Steve Lee (@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
Copy Markdown
Member

Tobias Käs (@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
Tobias Käs (weltkante) force-pushed the interop-fix branch 4 times, most recently from b2b0d26 to cba8116 Compare October 12, 2019 07:26
@weltkante

Copy link
Copy Markdown
Contributor Author

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

@SteveL-MSFT

Copy link
Copy Markdown
Member

PoshChan-Bot (@PoshChan) please retry windows

@PoshChan

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT), successfully started retry of PowerShell-CI-Windows

@SteveL-MSFT

Copy link
Copy Markdown
Member

Tobias Käs (@weltkante) the static analysis failures are understood and should not block this PR

@anmenaga

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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