----- Original Message -----
From: "David Rohacek" <[EMAIL PROTECTED]>


> Is the CLR able to identify the case where all assemblies in a call stack
> have full trust? Does it use this information to omit security checks or
> stack walks when demands are made?

Stack walks are not short-circuited just because all the assemblies have
full trust, because one or more of those assemblies may have placed a CAS
marker on the callstack that influences the way a subsequent Demand works.

>
> Does anyone have any ideas for how I can test this theory out?
>

Write an app that calls a library; where both are on the local file system
and (unless you've done something to your my_computer zone) will therefore
have full trust.  Have your app place a Deny marker on the stack before
calling into the library.  Have your library Demand that permission.  That
demand will fail with a security exception just the way you'd expect it to.
The fact that both assemblies have full trust doesn't cause the stack walk
be skipped (they'd still have to walk the stack to determine that all
callers have full trust...)

-Mike
http://staff.develop.com/woodring
http://www.develop.com/devresources

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to