﻿<?xml version="1.0" encoding="utf-8"?><Type Name="IStackWalk" FullName="System.Security.IStackWalk"><TypeSignature Maintainer="auto" Language="C#" Value="public interface IStackWalk" /><TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IStackWalk" /><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the &lt;link location="node:gtk-sharp/programming/threads"&gt;Gtk# Thread Programming&lt;/link&gt; for details.</ThreadSafetyStatement><Interfaces /><Attributes><Attribute><AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName></Attribute></Attributes><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Partially trusted code always presents a security risk. It can sometimes be manipulated to perform actions on behalf of malicious code that does not have permission to access a resource. In this way, malicious code can achieve higher security access than it should be allowed.</para><para>The common language runtime helps protect managed code from these attacks by running a stack walk on all calls. The stack walk requires that all code in the call stack has permission to access a protected resource. Because the code attempting the attack will always be somewhere in the call stack, it will be unable to exceed its own security permissions.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Manages the stack walk that determines whether all callers in the call stack have the required permissions to access a protected resource.</para></summary></Docs><Members><Member MemberName="Assert"><MemberSignature Language="C#" Value="public void Assert ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Assert() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Calling <see cref="M:System.Security.IStackWalk.Assert" /> stops the permission check on callers higher in the call stack. Therefore, even if these callers do not have the requisite permissions, they can still access resources. An assertion is effective only if the code that calls <see cref="M:System.Security.IStackWalk.Assert" /> passes the security check for the permission that it is asserting.</para><para>A call to <see cref="M:System.Security.IStackWalk.Assert" /> is effective until the calling code returns to its caller or until a subsequent call to <see cref="M:System.Security.IStackWalk.Assert" /> renders the previous assertion ineffective. Also, <see cref="M:System.Security.CodeAccessPermission.RevertAssert" /> or <see cref="M:System.Security.CodeAccessPermission.RevertAll" /> removes a pending <see cref="M:System.Security.IStackWalk.Assert" />.</para><para><see cref="M:System.Security.IStackWalk.Assert" /> is ignored for a permission not granted because a demand for that permission will not succeed. However, if code lower on the call stack calls <see cref="M:System.Security.IStackWalk.Demand" /> for that permission, a <see cref="T:System.Security.SecurityException" /> is thrown when the stack walk reaches the code that tried to call <see cref="M:System.Security.IStackWalk.Assert" />. This happens because the code that called <see cref="M:System.Security.IStackWalk.Assert" /> has not been granted the permission, even though it tried to <see cref="M:System.Security.IStackWalk.Assert" /> it.</para><block subset="none" type="note"><para>Because calling <see cref="M:System.Security.IStackWalk.Assert" /> removes the requirement that all code in the call chain must be granted permission to access the specified resource, it can open up security vulnerabilities if used incorrectly or inappropriately. Therefore, it should be used with great caution.</para></block></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Asserts that the calling code can access the resource identified by the current permission object, even if callers higher in the stack have not been granted permission to access the resource.</para></summary></Docs></Member><Member MemberName="Demand"><MemberSignature Language="C#" Value="public void Demand ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Demand() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>This method is typically used by secure libraries to ensure that callers have permission to access a resource. For example, a file class in a secure class library calls <see cref="M:System.Security.IStackWalk.Demand" /> for the necessary <see cref="T:System.Security.Permissions.FileIOPermission" /> before performing a file operation requested by the caller.</para><para>The permissions of the code that calls this method are not examined; the check begins from the immediate caller of that code and proceeds up the stack. <see cref="M:System.Security.IStackWalk.Demand" /> succeeds only if no <see cref="T:System.Security.SecurityException" /> is raised.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Determines at run time whether all callers in the call stack have been granted the permission specified by the current permission object.</para></summary></Docs></Member><Member MemberName="Deny"><MemberSignature Language="C#" Value="public void Deny ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Deny() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>This method prevents callers higher in the call stack from accessing the protected resource through the code that calls this method, even if those callers have been granted permission to access it. The call stack is typically represented as growing down, so that methods higher in the call stack call methods lower in the call stack.</para><para><see cref="M:System.Security.IStackWalk.Deny" /> can limit the liability of the programmer or help prevent accidental security vulnerabilities because it helps prevent the method that calls <see cref="M:System.Security.IStackWalk.Deny" /> from being used to access the resource protected by the denied permission. If a method calls <see cref="M:System.Security.IStackWalk.Deny" /> on a permission, and if a <see cref="M:System.Security.IStackWalk.Demand" /> for that permission is invoked by a caller lower in the call stack, that security check will fail when it reaches the <see cref="M:System.Security.IStackWalk.Deny" />.</para><para><see cref="M:System.Security.IStackWalk.Deny" /> is ignored for a permission not granted because a demand for that permission will not succeed.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Causes every <see cref="M:System.Security.IStackWalk.Demand" /> for the current object that passes through the calling code to fail.</para></summary></Docs></Member><Member MemberName="PermitOnly"><MemberSignature Language="C#" Value="public void PermitOnly ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void PermitOnly() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para><see cref="M:System.Security.IStackWalk.PermitOnly" /> is similar to <see cref="M:System.Security.IStackWalk.Deny" />, in that both cause stack walks to fail when they would otherwise succeed. The difference is that <see cref="M:System.Security.IStackWalk.Deny" /> specifies permissions that will cause the stack walk to fail, but <see cref="M:System.Security.IStackWalk.PermitOnly" /> specifies the only permissions that do not cause the stack walk to fail. Call this method to ensure that your code can be used to access only the specified resources.</para><para><see cref="M:System.Security.IStackWalk.PermitOnly" /> is ignored for a permission not granted because a demand for that permission will not succeed. However, if code lower on the call stack later calls <see cref="M:System.Security.IStackWalk.Demand" /> for that permission, a <see cref="T:System.Security.SecurityException" /> is thrown when the stack walk reaches the code that tried to call <see cref="M:System.Security.IStackWalk.PermitOnly" />. This is because the code that called <see cref="M:System.Security.IStackWalk.PermitOnly" /> has not been granted the permission, even though it called <see cref="M:System.Security.IStackWalk.PermitOnly" /> for that permission. The call stack is typically represented as growing down, so that methods higher in the call stack call methods lower in the call stack.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Causes every <see cref="M:System.Security.IStackWalk.Demand" /> for all objects except the current one that passes through the calling code to fail, even if code higher in the call stack has been granted permission to access other resources.</para></summary></Docs></Member></Members></Type>