<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Using Host Protection</title><link>http://blogs.msdn.com/b/shawnfa/archive/2005/10/13/480210.aspx</link><description>Yesterday we looked at what host protection is and what it does. Today lets modify the ADMHost sample code so that it disables access to self affecting and external threading operations. We'll then attempt to run a bit of code that launches 10 threads</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Using Host Protection</title><link>http://blogs.msdn.com/b/shawnfa/archive/2005/10/13/480210.aspx#556827</link><pubDate>Tue, 21 Mar 2006 21:16:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:556827</guid><dc:creator>shawnfa</dc:creator><description>Hi Michael,&lt;br&gt;&lt;br&gt;As I mentioned in this post, HostProtection is actually not a security feature but a reliability feature. &amp;nbsp;If you're trying to sandbox your addins, I recommend not using HostProtection, but instead using the AppDomain.CreateDomain overload which takes a permission set.&lt;br&gt;&lt;br&gt;Pass in a permission set which does not contain the ControlThread permission. &amp;nbsp;Then, add your assemblies to the FullTrust list of that domain. &amp;nbsp;This allows you to continue creating threads while preventing your addins from doing it. &amp;nbsp;Note that you'll have to Assert ControlThread before you actually kick off a thread otherwise the demand will fail at the AppDomain boundary.&lt;br&gt;&lt;br&gt;-Shawn&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=556827" width="1" height="1"&gt;</description></item><item><title>re: Using Host Protection</title><link>http://blogs.msdn.com/b/shawnfa/archive/2005/10/13/480210.aspx#555264</link><pubDate>Mon, 20 Mar 2006 06:11:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:555264</guid><dc:creator>Michael Bray</dc:creator><description>Hello. &amp;nbsp;I am looking for a way to prevent new AppDomains that I create from starting new threads (this is for a 'plugin' module that I'm playing with.) &amp;nbsp;Doing this in a CLR host app is not an option for me because I want my hosting application to be able to create threads, just not the plugins. &amp;nbsp;Can you suggest anything?&lt;br&gt;&lt;br&gt;-mdb&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=555264" width="1" height="1"&gt;</description></item><item><title>re: Using Host Protection</title><link>http://blogs.msdn.com/b/shawnfa/archive/2005/10/13/480210.aspx#489277</link><pubDate>Sat, 05 Nov 2005 02:44:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:489277</guid><dc:creator>shawnfa</dc:creator><description>Thanks Willy -- I've updated the code.&lt;br&gt;&lt;br&gt;-Shawn&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=489277" width="1" height="1"&gt;</description></item><item><title>re: Using Host Protection</title><link>http://blogs.msdn.com/b/shawnfa/archive/2005/10/13/480210.aspx#481079</link><pubDate>Fri, 14 Oct 2005 18:02:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:481079</guid><dc:creator>Willy Denoyette</dc:creator><description>Small typo in updated raw_Start:&lt;br&gt;    reinterpretcast&amp;lt;void **&amp;gt;(&amp;amp;pHostProtectionManager));&lt;br&gt;should be...&lt;br&gt;reinterpret_cast&amp;lt;void **....&lt;br&gt;&lt;br&gt;Willy.&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=481079" width="1" height="1"&gt;</description></item></channel></rss>