Skip to content

Cleanup System.Security.Permissions using directives and more comments #1272

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

Merged
merged 2 commits into from
Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion eng/WpfArcadeSdk/tools/TestProjects.targets
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerPackageVersion)" CopyLocal="true" />
<PackageReference Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogPackageVersion)" CopyLocal="true" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="$(SystemSecurityCryptographyXmlPackageVersion)" CopyLocal="true" />
<PackageReference Include="System.Security.Permissions" Version="$(SystemSecurityPermissionsPackageVersion)" CopyLocal="true" />
<PackageReference Include="System.Windows.Extensions" Version="$(SystemWindowsExtensionsPackageVersion)" CopyLocal="true" />

<PackageReference Include="System.Security.AccessControl" Version="$(SystemSecurityAccessControlPackageVersion)" CopyLocal="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@ public sealed class HostedWindowWrapper
{
/// <summary>
/// This is the only public constructor on this class.
/// It requires "Full Trust" level of security permissions to be executed, since this
/// class is wrappign an HWND direct access to which is a critical asset.
/// </summary>
public HostedWindowWrapper(IntPtr hwnd)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Security;
using System.Security.Permissions;
using System.Windows.Input;
using System.Windows.Media.Animation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Security;
using System.Security.Permissions;
using System.Windows.Input;
using System.Windows.Media.Animation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Security;
using System.Security.Permissions;
using System.Windows.Input;
using System.Windows.Media.Animation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using System.Collections;
using System.ComponentModel;
using System.Security;
using System.Security.Permissions;
using SR=MS.Internal.PresentationCore.SR;
using SRID=MS.Internal.PresentationCore.SRID;
using MS.Internal; // CommandHelper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,6 @@ private InputGestureCollection GetInputGestures()
/// Will be set by Rights Management code.
/// </summary>
/// <value></value>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
internal bool IsBlockedByRM
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ public sealed class InputManager : DispatcherObject
/// <summary>
/// Return the input manager associated with the current context.
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public static InputManager Current
{
get
Expand Down Expand Up @@ -180,10 +177,6 @@ private InputManager()
_inputTimer.Interval = TimeSpan.FromMilliseconds(125);
}

/// <summary></summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public event PreProcessInputEventHandler PreProcessInput
{
add
Expand All @@ -196,11 +189,6 @@ public event PreProcessInputEventHandler PreProcessInput
}
}


/// <summary></summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public event NotifyInputEventHandler PreNotifyInput
{
add
Expand All @@ -212,10 +200,6 @@ public event NotifyInputEventHandler PreNotifyInput
_preNotifyInput -= value;
}
}
/// <summary></summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public event NotifyInputEventHandler PostNotifyInput
{
add
Expand All @@ -228,10 +212,6 @@ public event NotifyInputEventHandler PostNotifyInput
}
}

/// <summary></summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public event ProcessInputEventHandler PostProcessInput
{
add
Expand Down Expand Up @@ -300,9 +280,6 @@ internal void UnregisterInputProvider(IInputProvider inputProvider)
/// <summary>
/// Returns a collection of input providers registered with the input manager.
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public ICollection InputProviders
{
get
Expand Down Expand Up @@ -568,7 +545,6 @@ private void ValidateInputDevices(object sender, EventArgs e)
/// The specified input is processed by all of the filters and
/// monitors, and is finally dispatched to the appropriate
/// element as an input event.
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
/// <returns>
/// Whether or not any event generated as a consequence of this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,10 +642,7 @@ public InputMethodState ImeState

/// <summary>
/// Access the current microphone on/off status.
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
/// </summary>
public InputMethodState MicrophoneState
{
get
Expand Down Expand Up @@ -716,9 +713,6 @@ public InputMethodState HandwritingState
/// <summary>
/// Access the current speech mode
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public SpeechMode SpeechMode
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ public KeyEventArgs(KeyboardDevice keyboard, PresentationSource inputSource, int
/// <summary>
/// The input source that provided this input.
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public PresentationSource InputSource
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ internal IInputElement ForceTarget
/// <summary>
/// Returns the PresentationSource that is reporting input for this device.
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>

public override PresentationSource ActiveSource
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ internal virtual void Reset(StagingAreaInputItem input, InputManager inputManage
/// <summary>
/// The input manager processing the input event.
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public InputManager InputManager
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ internal override void Reset(StagingAreaInputItem input, InputManager inputManag
/// <returns>
/// The staging area input item that wraps the specified input.
/// </returns>
///<remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
///</remarks>
public StagingAreaInputItem PushInput(InputEventArgs input,
StagingAreaInputItem promote) // Note: this should be a bool, and always use the InputItem available on these args.
{
Expand All @@ -73,10 +70,7 @@ public StagingAreaInputItem PushInput(InputEventArgs input,
/// </param>
/// <returns>
/// The specified staging area input item.
/// </returns>
///<remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
///</remarks>
/// </returns>
public StagingAreaInputItem PushInput(StagingAreaInputItem input)
{
if(!_allowAccessToStagingArea)
Expand All @@ -93,10 +87,7 @@ public StagingAreaInputItem PushInput(StagingAreaInputItem input)
/// <returns>
/// The input event that was on the top of the staging area.
/// This can be null, if the staging area was empty.
/// </returns>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
/// </returns>
public StagingAreaInputItem PopInput()
{

Expand All @@ -115,9 +106,6 @@ public StagingAreaInputItem PopInput()
/// The input event that is on the top of the staging area.
/// This can be null, if the staging area is empty.
/// </returns>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public StagingAreaInputItem PeekInput()
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ internal void Reset(InputEventArgs input, StagingAreaInputItem promote)
/// <summary>
/// Returns the input event.
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public InputEventArgs Input
{
get {return _input;}
Expand Down Expand Up @@ -83,9 +80,6 @@ public object GetData(object key)
/// <param name="value">
/// The data to set for this key. This can be null.
/// </param>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public void SetData(object key, object value)
{
_dictionary[key] = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ internal TextComposition(InputManager inputManager, IInputElement source, string
/// <summary>
/// Finalize the composition.
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public virtual void Complete()
{
// VerifyAccess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,6 @@ internal TextCompositionManager(InputManager inputManager)
/// <summary>
/// Start the composition.
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public static bool StartComposition(TextComposition composition)
{
return UnsafeStartComposition(composition);
Expand All @@ -296,9 +293,6 @@ public static bool StartComposition(TextComposition composition)
/// <summary>
/// Update the composition.
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public static bool UpdateComposition(TextComposition composition)
{
return UnsafeUpdateComposition(composition);
Expand All @@ -307,9 +301,6 @@ public static bool UpdateComposition(TextComposition composition)
/// <summary>
/// Complete the composition.
/// </summary>
/// <remarks>
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
/// </remarks>
public static bool CompleteComposition(TextComposition composition)
{
return UnsafeCompleteComposition(composition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2631,9 +2631,6 @@ public bool DetachHwndTarget(HwndTarget hwndTarget)
/// <summary>
/// Handles the messages for the notification window
/// </summary>
/// <SecurityNode>
/// Critical: Elevates permissions via unsafe native methods
/// </SecurityNode>
private IntPtr NotificationFilterMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
IntPtr retInt = IntPtr.Zero;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Security;
using System.Security.Permissions;
using System.Windows.Threading;
using System.Windows.Media.Animation;
using System.Windows.Media.Composition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using System.Windows.Media.Composition;
using System.Windows.Media.Media3D;
using System.Security;
using System.Security.Permissions;

namespace System.Windows.Media.Animation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using System.Windows.Media.Composition;
using System.Windows.Media.Media3D;
using System.Security;
using System.Security.Permissions;

namespace System.Windows.Media.Animation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using System.Windows.Media.Composition;
using System.Windows.Media.Media3D;
using System.Security;
using System.Security.Permissions;

namespace System.Windows.Media.Animation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
using System.Windows.Markup;
using System.Windows.Media.Converters;
using System.Security;
using System.Security.Permissions;
using SR=MS.Internal.PresentationCore.SR;
using SRID=MS.Internal.PresentationCore.SRID;
// These types are aliased to match the unamanaged names used in interop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using System.Windows.Media.Composition;
using System.Windows.Media.Media3D;
using System.Security;
using System.Security.Permissions;

namespace System.Windows.Media.Animation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using System.Windows.Media.Composition;
using System.Windows.Media.Media3D;
using System.Security;
using System.Security.Permissions;

namespace System.Windows.Media.Animation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using System.Windows.Media.Composition;
using System.Windows.Media.Media3D;
using System.Security;
using System.Security.Permissions;

namespace System.Windows.Media.Animation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using System.Windows.Media.Composition;
using System.Windows.Media.Media3D;
using System.Security;
using System.Security.Permissions;

namespace System.Windows.Media.Animation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using System.Windows.Media.Composition;
using System.Windows.Media.Media3D;
using System.Security;
using System.Security.Permissions;

namespace System.Windows.Media.Animation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
using System.Windows.Markup;
using System.Windows.Media.Converters;
using System.Security;
using System.Security.Permissions;
using SR=MS.Internal.PresentationCore.SR;
using SRID=MS.Internal.PresentationCore.SRID;
// These types are aliased to match the unamanaged names used in interop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
using System.Windows.Markup;
using System.Windows.Media.Converters;
using System.Security;
using System.Security.Permissions;
using SR=MS.Internal.PresentationCore.SR;
using SRID=MS.Internal.PresentationCore.SRID;
// These types are aliased to match the unamanaged names used in interop
Expand Down
Loading