Skip to content

Commit 52f24ad

Browse files
authored
Cleanup System.Security.Permissions using directives and more comments (#1272)
* permissions cleanup * comment removals
1 parent 28bb9f7 commit 52f24ad

File tree

231 files changed

+3
-923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+3
-923
lines changed

eng/WpfArcadeSdk/tools/TestProjects.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerPackageVersion)" CopyLocal="true" />
3131
<PackageReference Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogPackageVersion)" CopyLocal="true" />
3232
<PackageReference Include="System.Security.Cryptography.Xml" Version="$(SystemSecurityCryptographyXmlPackageVersion)" CopyLocal="true" />
33-
<PackageReference Include="System.Security.Permissions" Version="$(SystemSecurityPermissionsPackageVersion)" CopyLocal="true" />
3433
<PackageReference Include="System.Windows.Extensions" Version="$(SystemWindowsExtensionsPackageVersion)" CopyLocal="true" />
3534

3635
<PackageReference Include="System.Security.AccessControl" Version="$(SystemSecurityAccessControlPackageVersion)" CopyLocal="true" />

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Automation/Peers/AutomationPeer.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ public sealed class HostedWindowWrapper
219219
{
220220
/// <summary>
221221
/// This is the only public constructor on this class.
222-
/// It requires "Full Trust" level of security permissions to be executed, since this
223-
/// class is wrappign an HWND direct access to which is a critical asset.
224222
/// </summary>
225223
public HostedWindowWrapper(IntPtr hwnd)
226224
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Generated/ContentElement.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
using System.ComponentModel;
1919
using System.Diagnostics;
2020
using System.Security;
21-
using System.Security.Permissions;
2221
using System.Windows.Input;
2322
using System.Windows.Media.Animation;
2423

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Generated/UIElement.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
using System.ComponentModel;
1919
using System.Diagnostics;
2020
using System.Security;
21-
using System.Security.Permissions;
2221
using System.Windows.Input;
2322
using System.Windows.Media.Animation;
2423

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Generated/UIElement3D.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
using System.ComponentModel;
1919
using System.Diagnostics;
2020
using System.Security;
21-
using System.Security.Permissions;
2221
using System.Windows.Input;
2322
using System.Windows.Media.Animation;
2423

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Command/ApplicationCommands.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
using System.Collections;
2121
using System.ComponentModel;
2222
using System.Security;
23-
using System.Security.Permissions;
2423
using SR=MS.Internal.PresentationCore.SR;
2524
using SRID=MS.Internal.PresentationCore.SRID;
2625
using MS.Internal; // CommandHelper

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Command/RoutedCommand.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,6 @@ private InputGestureCollection GetInputGestures()
284284
/// Will be set by Rights Management code.
285285
/// </summary>
286286
/// <value></value>
287-
/// <remarks>
288-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
289-
/// </remarks>
290287
internal bool IsBlockedByRM
291288
{
292289
get

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/InputManager.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ public sealed class InputManager : DispatcherObject
4040
/// <summary>
4141
/// Return the input manager associated with the current context.
4242
/// </summary>
43-
/// <remarks>
44-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
45-
/// </remarks>
4643
public static InputManager Current
4744
{
4845
get
@@ -180,10 +177,6 @@ private InputManager()
180177
_inputTimer.Interval = TimeSpan.FromMilliseconds(125);
181178
}
182179

183-
/// <summary></summary>
184-
/// <remarks>
185-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
186-
/// </remarks>
187180
public event PreProcessInputEventHandler PreProcessInput
188181
{
189182
add
@@ -196,11 +189,6 @@ public event PreProcessInputEventHandler PreProcessInput
196189
}
197190
}
198191

199-
200-
/// <summary></summary>
201-
/// <remarks>
202-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
203-
/// </remarks>
204192
public event NotifyInputEventHandler PreNotifyInput
205193
{
206194
add
@@ -212,10 +200,6 @@ public event NotifyInputEventHandler PreNotifyInput
212200
_preNotifyInput -= value;
213201
}
214202
}
215-
/// <summary></summary>
216-
/// <remarks>
217-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
218-
/// </remarks>
219203
public event NotifyInputEventHandler PostNotifyInput
220204
{
221205
add
@@ -228,10 +212,6 @@ public event NotifyInputEventHandler PostNotifyInput
228212
}
229213
}
230214

231-
/// <summary></summary>
232-
/// <remarks>
233-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
234-
/// </remarks>
235215
public event ProcessInputEventHandler PostProcessInput
236216
{
237217
add
@@ -300,9 +280,6 @@ internal void UnregisterInputProvider(IInputProvider inputProvider)
300280
/// <summary>
301281
/// Returns a collection of input providers registered with the input manager.
302282
/// </summary>
303-
/// <remarks>
304-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
305-
/// </remarks>
306283
public ICollection InputProviders
307284
{
308285
get
@@ -568,7 +545,6 @@ private void ValidateInputDevices(object sender, EventArgs e)
568545
/// The specified input is processed by all of the filters and
569546
/// monitors, and is finally dispatched to the appropriate
570547
/// element as an input event.
571-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
572548
/// </remarks>
573549
/// <returns>
574550
/// Whether or not any event generated as a consequence of this

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/InputMethod.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,7 @@ public InputMethodState ImeState
642642

643643
/// <summary>
644644
/// Access the current microphone on/off status.
645-
/// </summary>
646-
/// <remarks>
647-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
648-
/// </remarks>
645+
/// </summary>
649646
public InputMethodState MicrophoneState
650647
{
651648
get
@@ -716,9 +713,6 @@ public InputMethodState HandwritingState
716713
/// <summary>
717714
/// Access the current speech mode
718715
/// </summary>
719-
/// <remarks>
720-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
721-
/// </remarks>
722716
public SpeechMode SpeechMode
723717
{
724718
get

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/KeyEventArgs.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ public KeyEventArgs(KeyboardDevice keyboard, PresentationSource inputSource, int
5151
/// <summary>
5252
/// The input source that provided this input.
5353
/// </summary>
54-
/// <remarks>
55-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
56-
/// </remarks>
5754
public PresentationSource InputSource
5855
{
5956
get

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/KeyboardDevice.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ internal IInputElement ForceTarget
8888
/// <summary>
8989
/// Returns the PresentationSource that is reporting input for this device.
9090
/// </summary>
91-
/// <remarks>
92-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
93-
/// </remarks>
94-
9591
public override PresentationSource ActiveSource
9692
{
9793
get

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/NotifyInputEventArgs.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ internal virtual void Reset(StagingAreaInputItem input, InputManager inputManage
4040
/// <summary>
4141
/// The input manager processing the input event.
4242
/// </summary>
43-
/// <remarks>
44-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
45-
/// </remarks>
4643
public InputManager InputManager
4744
{
4845
get

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/ProcessInputEventArgs.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ internal override void Reset(StagingAreaInputItem input, InputManager inputManag
5050
/// <returns>
5151
/// The staging area input item that wraps the specified input.
5252
/// </returns>
53-
///<remarks>
54-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
55-
///</remarks>
5653
public StagingAreaInputItem PushInput(InputEventArgs input,
5754
StagingAreaInputItem promote) // Note: this should be a bool, and always use the InputItem available on these args.
5855
{
@@ -73,10 +70,7 @@ public StagingAreaInputItem PushInput(InputEventArgs input,
7370
/// </param>
7471
/// <returns>
7572
/// The specified staging area input item.
76-
/// </returns>
77-
///<remarks>
78-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
79-
///</remarks>
73+
/// </returns>
8074
public StagingAreaInputItem PushInput(StagingAreaInputItem input)
8175
{
8276
if(!_allowAccessToStagingArea)
@@ -93,10 +87,7 @@ public StagingAreaInputItem PushInput(StagingAreaInputItem input)
9387
/// <returns>
9488
/// The input event that was on the top of the staging area.
9589
/// This can be null, if the staging area was empty.
96-
/// </returns>
97-
/// <remarks>
98-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
99-
/// </remarks>
90+
/// </returns>
10091
public StagingAreaInputItem PopInput()
10192
{
10293

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

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/StagingAreaInputItem.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ internal void Reset(InputEventArgs input, StagingAreaInputItem promote)
5050
/// <summary>
5151
/// Returns the input event.
5252
/// </summary>
53-
/// <remarks>
54-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
55-
/// </remarks>
5653
public InputEventArgs Input
5754
{
5855
get {return _input;}
@@ -83,9 +80,6 @@ public object GetData(object key)
8380
/// <param name="value">
8481
/// The data to set for this key. This can be null.
8582
/// </param>
86-
/// <remarks>
87-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
88-
/// </remarks>
8983
public void SetData(object key, object value)
9084
{
9185
_dictionary[key] = value;

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/TextComposition.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ internal TextComposition(InputManager inputManager, IInputElement source, string
142142
/// <summary>
143143
/// Finalize the composition.
144144
/// </summary>
145-
/// <remarks>
146-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
147-
/// </remarks>
148145
public virtual void Complete()
149146
{
150147
// VerifyAccess();

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/TextCompositionManager.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,6 @@ internal TextCompositionManager(InputManager inputManager)
285285
/// <summary>
286286
/// Start the composition.
287287
/// </summary>
288-
/// <remarks>
289-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
290-
/// </remarks>
291288
public static bool StartComposition(TextComposition composition)
292289
{
293290
return UnsafeStartComposition(composition);
@@ -296,9 +293,6 @@ public static bool StartComposition(TextComposition composition)
296293
/// <summary>
297294
/// Update the composition.
298295
/// </summary>
299-
/// <remarks>
300-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
301-
/// </remarks>
302296
public static bool UpdateComposition(TextComposition composition)
303297
{
304298
return UnsafeUpdateComposition(composition);
@@ -307,9 +301,6 @@ public static bool UpdateComposition(TextComposition composition)
307301
/// <summary>
308302
/// Complete the composition.
309303
/// </summary>
310-
/// <remarks>
311-
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
312-
/// </remarks>
313304
public static bool CompleteComposition(TextComposition composition)
314305
{
315306
return UnsafeCompleteComposition(composition);

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/InterOp/HwndTarget.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2631,9 +2631,6 @@ public bool DetachHwndTarget(HwndTarget hwndTarget)
26312631
/// <summary>
26322632
/// Handles the messages for the notification window
26332633
/// </summary>
2634-
/// <SecurityNode>
2635-
/// Critical: Elevates permissions via unsafe native methods
2636-
/// </SecurityNode>
26372634
private IntPtr NotificationFilterMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
26382635
{
26392636
IntPtr retInt = IntPtr.Zero;

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/Animatable.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using System.Collections.Generic;
2323
using System.Diagnostics;
2424
using System.Security;
25-
using System.Security.Permissions;
2625
using System.Windows.Threading;
2726
using System.Windows.Media.Animation;
2827
using System.Windows.Media.Composition;

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/ColorIndependentAnimationStorage.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using System.Windows.Media.Composition;
2323
using System.Windows.Media.Media3D;
2424
using System.Security;
25-
using System.Security.Permissions;
2625

2726
namespace System.Windows.Media.Animation
2827
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/DoubleIndependentAnimationStorage.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using System.Windows.Media.Composition;
2323
using System.Windows.Media.Media3D;
2424
using System.Security;
25-
using System.Security.Permissions;
2625

2726
namespace System.Windows.Media.Animation
2827
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/MatrixIndependentAnimationStorage.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using System.Windows.Media.Composition;
2323
using System.Windows.Media.Media3D;
2424
using System.Security;
25-
using System.Security.Permissions;
2625

2726
namespace System.Windows.Media.Animation
2827
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/ParallelTimeline.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
using System.Windows.Markup;
3434
using System.Windows.Media.Converters;
3535
using System.Security;
36-
using System.Security.Permissions;
3736
using SR=MS.Internal.PresentationCore.SR;
3837
using SRID=MS.Internal.PresentationCore.SRID;
3938
// These types are aliased to match the unamanaged names used in interop

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/Point3DIndependentAnimationStorage.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using System.Windows.Media.Composition;
2323
using System.Windows.Media.Media3D;
2424
using System.Security;
25-
using System.Security.Permissions;
2625

2726
namespace System.Windows.Media.Animation
2827
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/PointIndependentAnimationStorage.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using System.Windows.Media.Composition;
2323
using System.Windows.Media.Media3D;
2424
using System.Security;
25-
using System.Security.Permissions;
2625

2726
namespace System.Windows.Media.Animation
2827
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/QuaternionIndependentAnimationStorage.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using System.Windows.Media.Composition;
2323
using System.Windows.Media.Media3D;
2424
using System.Security;
25-
using System.Security.Permissions;
2625

2726
namespace System.Windows.Media.Animation
2827
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/RectIndependentAnimationStorage.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using System.Windows.Media.Composition;
2323
using System.Windows.Media.Media3D;
2424
using System.Security;
25-
using System.Security.Permissions;
2625

2726
namespace System.Windows.Media.Animation
2827
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/SizeIndependentAnimationStorage.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using System.Windows.Media.Composition;
2323
using System.Windows.Media.Media3D;
2424
using System.Security;
25-
using System.Security.Permissions;
2625

2726
namespace System.Windows.Media.Animation
2827
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/Timeline.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
using System.Windows.Markup;
3434
using System.Windows.Media.Converters;
3535
using System.Security;
36-
using System.Security.Permissions;
3736
using SR=MS.Internal.PresentationCore.SR;
3837
using SRID=MS.Internal.PresentationCore.SRID;
3938
// These types are aliased to match the unamanaged names used in interop

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/TimelineCollection.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
using System.Windows.Markup;
3434
using System.Windows.Media.Converters;
3535
using System.Security;
36-
using System.Security.Permissions;
3736
using SR=MS.Internal.PresentationCore.SR;
3837
using SRID=MS.Internal.PresentationCore.SRID;
3938
// These types are aliased to match the unamanaged names used in interop

0 commit comments

Comments
 (0)