Out of Memory

本ブログは更新を停止しました。Aerieをよろしくお願いいたします。

目次

Blog 利用状況

ニュース

2009年3月31日
更新を停止しました。引き続きAerieを御愛顧くださいませ。
2009年2月3日
原則としてコメント受付を停止しました。コメントはAerieまでお願いいたします。
詳細は2月3日のエントリをご覧ください。
2008年7月1日
Microsoft MVP for Developer Tools - Visual C++ を再受賞しました。
2008年2月某日
MVPアワードがVisual C++に変更になりました。
2007年10月23日
blogタイトルを変更しました。
2007年7月1日
Microsoft MVP for Windows - SDKを受賞しました!
2007年6月20日
スキル「ニュース欄ハック」を覚えた!
2006年12月14日
記念すべき初エントリ
2006年12月3日
わんくま同盟に加盟しました。

カレンダー

中の人

αετο? / aetos / あえとす

シャノン? 誰それ。

顔写真

埼玉を馬鹿にする奴は俺が許さん。

基本的に知ったかぶり。興味を持った技術に手を出して、ちょっと齧りはするものの、それを応用して何か形にするまでは及ばずに飽きて放り出す人。

書庫

日記カテゴリ

RealProxy使えねぇー:2

前回の続きというか補足。

RealProxyは、プロキシを被せる相手によっては使えない、という話をした。
ただ、使えないというのは、漏れがあるということで、そう致命的ではない。

今日は致命的な話。というかこれは欠陥じゃないのか。
発生する例外はRemotingException。リファレンスによれば、これは呼び出し元コンテキストが不正な場合に起きるんだとか。
今回のケースでは、これは当てはまらない。


using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;
static class Program
{
    [STAThread]
    static void Main()
    {
        OuterClass outer = (OuterClass)new IdiotProxy(new OuterClass()).GetTransparentProxy();
        try
        {
            outer.Inner.Fault(outer);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.ToString());
        }
    }
}
class IdiotProxy : RealProxy
{
    private readonly MarshalByRefObject _target;
    public IdiotProxy(MarshalByRefObject target)
        : base(target.GetType())
    {
        _target = target;
    }
    public override IMessage Invoke(IMessage msg)
    {
        return RemotingServices.ExecuteMessage(_target, (IMethodCallMessage)msg);
    }
}
class OuterClass : MarshalByRefObject
{
    private int _privateField = 0;
    private readonly InnerClass _inner = new InnerClass();
    public class InnerClass
    {
        public void Fault(OuterClass outer)
        {
            outer._privateField = 1;
        }
    }
    public InnerClass Inner
    {
        get
        {
            return _inner;
        }
    }
}

投稿日時 : 2007年1月11日 16:49

Feedback

# re: RealProxy使えねぇー:2 2007/01/11 16:52 シャノン

正確にはRealProxyじゃなくてRemotingServicesが使えねぇんだが。

# I аm curious to find out hat blog ѕystem yoᥙ have been utilizing? I'm experiencing sօme minor security proƅlems ԝith my lаtest website аnd I w᧐uld lіke tо find something morе safeguarded. Ⅾo yyou have any recommendations? 2019/03/24 3:44 I am curious tto fіnd oᥙt whatt blog systеm уoᥙ hа

? amm curiious tо find o?t wh?t blog ?ystem yyou h?ve
Ьeen utilizing? I'm experiencing somе minor security рroblems wwith my ?atest website ?nd I wou?d l?ke to find something mоre safeguarded.
Do у?u haνe any recommendations?

# Hi, уeѕ tһiѕ paragraph iѕ genuiinely fastidious аnd I havе learned ⅼot ⲟf things fгom it cooncerning blogging. tһanks. 2019/03/24 17:16 Ηi, yes tһis paragraph іs genuinely fastidious ɑnd

Ηi, yes tnis paragraph is genuinely fastidious and Ι ha?e
learned ?ot of th?ngs fom ?t c?ncerning blogging.
t?anks.

# Hi theгe! Someone іn my Facebook grroup shared thiss site wih սѕ so I came to check it out. I'm definitely loving the information. I'm book-marking and will Ьe tweeting thіs tо my followers! Terrific blog ɑnd excellent design. 2019/04/01 23:48 Нi there! Someokne in my Facebook ɡroup shared th

Hi t?ere! Someone in my Facebook grooup shared t?is site w?th us so Ι cаme
to check it o?t. ?'m definite?? loving the ?nformation. I'm book-marking and ?ill bee tweeting
t??s to my followers! Terrific blog ?nd excrllent
design.

タイトル
名前
Url
コメント