Skip to content

Remove MapSecurityZoneWithUrlmon method and related code - #7103

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
rjmholt:remove-mapzonewithurlmon-6919
Jun 25, 2018
Merged

Remove MapSecurityZoneWithUrlmon method and related code#7103
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
rjmholt:remove-mapzonewithurlmon-6919

Conversation

@rjmholt

@rjmholt Rob Holt (rjmholt) commented Jun 18, 2018

Copy link
Copy Markdown
Collaborator

PR Summary

Fixes #6919: Removes the MapSecurityZoneWithUrlmon method and the native interface it uses.

MapSecurityZoneWithUrlmon uses an unsupported API call, and this ensures we use a supported API to improve quality.

PR Checklist

@anmenaga Andrew (anmenaga) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Neither "PR Summary" nor original issue have a description why this change is necessary.

@TravisEz13 Travis Plunk (TravisEz13) added the Compliance Related to compliance requirements label Jun 18, 2018
@TravisEz13

Copy link
Copy Markdown
Member

Andrew (@anmenaga)

Neither "PR Summary" nor original issue have a description why this change is necessary.

Rob Holt (@rjmholt) says in the summary

MapSecurityZoneWithUrlmon uses an unsupported API call, and this ensures we use a supported API to improve quality.

@@ -139,19 +139,11 @@ internal static SecurityZone GetFileSecurityZone(string filePath)
Diagnostics.Assert(Path.IsPathRooted(filePath), "Caller makes sure the path is rooted.");
Diagnostics.Assert(Utils.FileExists(filePath), "Caller makes sure the file exists.");
string sysRoot = System.Environment.GetEnvironmentVariable("SystemRoot");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This variable is not used anymore.

@@ -448,60 +403,6 @@ private static class NativeMethods
internal static extern uint GetACP();

public const int S_OK = 0x00000000;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this one still used anywhere?

@@ -448,60 +403,6 @@ private static class NativeMethods
internal static extern uint GetACP();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This function doesn't seem to be used anymore.

@anmenaga

Copy link
Copy Markdown

Travis Plunk (@TravisEz13) "edited" after I posted the request. :)

@TravisEz13

Copy link
Copy Markdown
Member

Andrew (@anmenaga) I'm not sure you get notified of edits and the timing wasn't perfectly clear.

@rjmholt

Copy link
Copy Markdown
Collaborator Author

Looks like the test failure is pwrshplugin.dll:

  Describing JEA session Get-Help test
    [-] Error occurred in Describe block 9.84s
      ItemNotFoundException: Cannot find path 'C:\projects\powershell\src\powershell-win-core\bin\Release
      etcoreapp2.1\win7-x64\publish\pwrshplugin.dll' because it does not exist.

@rjmholt

Copy link
Copy Markdown
Collaborator Author

Not sure if that can be fixed in this PR

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

Labels

Compliance Related to compliance requirements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use MapSecurityZoneWithoutUrlmon and remove MapSecurityZoneWithUrlmon and related native code

4 participants