-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Enable ApartmentState support #4772
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,9 +18,7 @@ | |
| using System.Globalization; | ||
| using System.Security; | ||
| using System.Threading; | ||
| #if CORECLR | ||
| using System.Xml.XPath; | ||
| #endif | ||
|
|
||
| using Dbg = System.Management.Automation; | ||
|
|
||
|
|
@@ -335,15 +333,6 @@ private void DeleteDelegateSettings(string applicationname, RegistryKey rootKey, | |
| /// </summary> | ||
| protected override void BeginProcessing() | ||
| { | ||
| #if !CORECLR | ||
| if (Environment.OSVersion.Version.Major < 6) | ||
| { | ||
| //OS is XP/Win2k3. Throw error. | ||
| WSManHelper helper = new WSManHelper(this); | ||
| string message = helper.FormatResourceMsgFromResourcetext("CmdletNotAvailable"); | ||
| throw new InvalidOperationException(message); | ||
| } | ||
| #endif | ||
| //If not running elevated, then throw an "elevation required" error message. | ||
| WSManHelper.ThrowIfNotAdministrator(); | ||
|
|
||
|
|
@@ -453,14 +442,6 @@ protected override void BeginProcessing() | |
| //If not running elevated, then throw an "elevation required" error message. | ||
| WSManHelper.ThrowIfNotAdministrator(); | ||
| helper = new WSManHelper(this); | ||
| #if !CORECLR | ||
| if (Environment.OSVersion.Version.Major < 6) | ||
| { | ||
| //OS is XP/Win2k3. Throw error. | ||
| string message = helper.FormatResourceMsgFromResourcetext("CmdletNotAvailable"); | ||
| throw new InvalidOperationException(message); | ||
| } | ||
| #endif | ||
|
|
||
| // DelegateComputer cannot be specified when Role is other than client | ||
| if ((delegatecomputer != null) && !Role.Equals(Client, StringComparison.OrdinalIgnoreCase)) | ||
|
|
@@ -725,23 +706,15 @@ private void UpdateGPORegistrySettings(string applicationname, string[] delegate | |
| //open the registry key.If key is not present,create a new one | ||
| Credential_Delegation_Key = rootKey.OpenSubKey(Registry_Path_Credentials_Delegation, true); | ||
| if (Credential_Delegation_Key == null) | ||
| Credential_Delegation_Key = rootKey.CreateSubKey(Registry_Path_Credentials_Delegation | ||
| #if !CORECLR | ||
| , RegistryKeyPermissionCheck.ReadWriteSubTree | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| #endif | ||
| ); | ||
| Credential_Delegation_Key = rootKey.CreateSubKey(Registry_Path_Credentials_Delegation); | ||
|
|
||
| Credential_Delegation_Key.SetValue(helper.Key_Allow_Fresh_Credentials, 1, RegistryValueKind.DWord); | ||
| Credential_Delegation_Key.SetValue(helper.Key_Concatenate_Defaults_AllowFresh, 1, RegistryValueKind.DWord); | ||
|
|
||
| // add the delegate value | ||
| Allow_Fresh_Credential_Key = rootKey.OpenSubKey(Registry_Path_Credentials_Delegation + @"\" + helper.Key_Allow_Fresh_Credentials, true); | ||
| if (Allow_Fresh_Credential_Key == null) | ||
| Allow_Fresh_Credential_Key = rootKey.CreateSubKey(Registry_Path_Credentials_Delegation + @"\" + helper.Key_Allow_Fresh_Credentials | ||
| #if !CORECLR | ||
| , RegistryKeyPermissionCheck.ReadWriteSubTree | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| #endif | ||
| ); | ||
| Allow_Fresh_Credential_Key = rootKey.CreateSubKey(Registry_Path_Credentials_Delegation + @"\" + helper.Key_Allow_Fresh_Credentials); | ||
|
|
||
| if (Allow_Fresh_Credential_Key != null) | ||
| { | ||
|
|
@@ -890,14 +863,6 @@ protected override void BeginProcessing() | |
| WSManHelper.ThrowIfNotAdministrator(); | ||
|
|
||
| helper = new WSManHelper(this); | ||
| #if !CORECLR | ||
| if (Environment.OSVersion.Version.Major < 6) | ||
| { | ||
| //OS is XP/Win2k3. Throw error. | ||
| string message = helper.FormatResourceMsgFromResourcetext("CmdletNotAvailable"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the resource string |
||
| throw new InvalidOperationException(message); | ||
| } | ||
| #endif | ||
|
|
||
| IWSManSession m_SessionObj = null; | ||
| try | ||
|
|
||
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.
Is this line supposed to be removed?