OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: John Beck (jbeckMICROSOFT.COM)
Date: Sun Jun 10 2001 - 02:16:19 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    GUST IN TIME.
     
    No, really, its in MSDN:
     
    To address this need, the Windows NT® 4.0 Service Pack 3 release of COM
    introduced the Global Interface Table (GIT). The GIT is an optimization
    of CoMarshalInterface/CoUnmarshalInterface that allows interface
    pointers to be accessed by all apartments in a process. COM internally
    implements one GIT per process. The GIT contains marshaled interface
    pointers that can be efficiently unmarshaled multiple times within the
    same process. This is the semantic equivalent of using table marshaling,
    but the GIT can be used with both objects and proxies.
          The GIT exposes the IGlobalInterfaceTable interface:

     interface IGlobalInterfaceTable : IUnknown {
     // marshal an interface into the GIT
       HRESULT RegisterInterfaceInGlobal(
                   [in] REFIID riid,
                   [in, iid_is(riid)] IUnknown *pItf,
                   [out] DWORD *pdwCookie);
     // destroy the marshaled object reference
       HRESULT RevokeInterfaceFromGlobal(
                   [in] DWORD dwCookie);
     // unmarshal an interface from the GIT
       HRESULT GetInterfaceFromGlobal (
                   [in] DWORD dwCookie
                   [in] REFIID riid,
                   [out, iid_is(riid)] void **ppv);
     }
    Clients gain access to the GIT for their process by calling
    CoCreateInstance using the class CLSID_StdGlobalInterfaceTable. Each
    call to CoCreateInstance using this CLSID returns a pointer to the
    single GIT of the process. Like the IStream interface returned by
    CoMarshalInterThreadInterfaceInStream, interface pointers to the GIT can
    be accessed from any apartment without requiring marshaling.

            -----Original Message-----
            From: Raheem Rufai
            Sent: Sat 6/9/2001 10:19 PM
            To: DCOMDISCUSS.MICROSOFT.COM
            Cc:
            Subject: Re: CoMarshalInterThreadInterfaceInStream limit
            
            

            What is GIT?
            
            ----- Original Message -----
            From: "Leon Finker" <lf21NETZERO.NET>
            To: <DCOMdiscuss.microsoft.com>
            Sent: Sunday, June 10, 2001 7:22 AM
            Subject: Re: CoMarshalInterThreadInterfaceInStream limit
            
            
    > Yes, I'll have to use GIT. It's limit seems to be almost
    2^32 per
            process.
    > So it is a much better solution.
    > But I was asked to minimize any dependencies on the updates to
    the OS.
    > GIT requires SP3 for NT4 and DCOM 1.2 for Win95.
    >
    > Thanx
    >
    > ----- Original Message -----
    > From: "Brian Muth" <bmuthSWI.COM>
    > To: <DCOMDISCUSS.MICROSOFT.COM>
    > Sent: Friday, June 08, 2001 9:02 PM
    > Subject: Re: CoMarshalInterThreadInterfaceInStream limit
    >
    >
    > Why don't you use the GIT? It is a much better solution.
    >
    > Brian
    >
    > > -----Original Message-----
    > > From: Leon Finker [mailto:lf21NETZERO.NET]
    > > Sent: Friday, June 08, 2001 3:57 PM
    > > To: DCOMDISCUSS.MICROSOFT.COM
    > > Subject: CoMarshalInterThreadInterfaceInStream limit
    > >
    > >
    > > Hi All,
    > >
    > > It seems that CoMarshalInterThreadInterfaceInStream can be
    called only
    > > 32,769 times in a row on a pointer
    > > to some COM object without balanced
    > > CoGetInterfaceAndReleaseStream calls.
    > >
    > > I receive a pointer to COM component and I
    > > CoMarshalInterThreadInterfaceInStream it to process it on
    > > another thread
    > > (involves sending the
    > > data it contains over a socket). So, I can easily have more
    > > CoMarshalInterThreadInterfaceInStream calls before they are
    actiually
    > > processed.
    > > Never thought it would have a limit like that.
    > >
    > > The error I get back is 0x8007000E -"Not enough storage is
    > > available to
    > > complete this operation. " But the whole process hardly
    > > takes 10 megs and
    > > the overall
    > > memory is not even 25% used.
    > >
    > > Imaginary ex.:
    > > IUnknown* pUnk;
    > > HRESULT hr = CoCreateInstance(CLSID_Something, 0,
    CLSCTX_INPROC,
    > > IID_IUnknown, (void**)&pUnk);
    > > IStream* pStream;
    > > int i =0;
    > > while(true)
    > > {
    > > i++;
    > > hr = CoMarshalInterThreadInterfaceInStream(IID_IUnknown,
    > > pUnk, &pStream);
    > > ATLASSERT(!FAILED(hr));
    > > }
    > >
    > > It should assert fairly quick and i will always be equal to
    32,769
    > >
    > >
    > > NetZero Platinum
    > > No Banner Ads and Unlimited Access
    > > Sign Up Today - Only $9.95 per month!
    > > http://www.netzero.net
    > >
    > >
    ----------------------------------------------------------------
    > > Users Guide
    http://msdn.microsoft.com/workshop/essentials/mail.asp
    > > contains important info. Save time, search the archives at
    > > http://discuss.microsoft.com/archives/index.html .
    > > To unsubscribe,
    mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM
    > >
    >
    >
    ----------------------------------------------------------------
    > Users Guide
    http://msdn.microsoft.com/workshop/essentials/mail.asp
    > contains important info. Save time, search the archives at
    > http://discuss.microsoft.com/archives/index.html .
    > To unsubscribe,
    mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM
    >
    >
    >
    >
    >
    > NetZero Platinum
    > No Banner Ads and Unlimited Access
    > Sign Up Today - Only $9.95 per month!
    > http://www.netzero.net
    >
    >
    ----------------------------------------------------------------
    > Users Guide
    http://msdn.microsoft.com/workshop/essentials/mail.asp
    > contains important info. Save time, search the archives at
    > http://discuss.microsoft.com/archives/index.html .
    > To unsubscribe,
    mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM
    >
            
            ----------------------------------------------------------------
            Users Guide
    http://msdn.microsoft.com/workshop/essentials/mail.asp
            contains important info. Save time, search the archives at
            http://discuss.microsoft.com/archives/index.html .
            To unsubscribe,
    mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM
            

    Rǫkumg'+&
    +h퉩lf)rj)jh֧)ߡ&zئzǚmrzƭibˬh(~(rzױ٥Nrzf, }ު笴2 D09#L#