Docstoc

COM DCOM

Document Sample
COM DCOM Powered By Docstoc
					COM/DCOM
and COM+ Internals

C. S. Hong
KHU
COM/DCOM
   Component Object Model
       developed 1983
       OLE2 used COM (OLE/COM)
   Distributed COM
       developed June, 1996
         deployed on Windows 4.0
       OS independent architecture
         Digital Equipment (UNIX)
         HP (UNIX)
COM: Third Generation
Components
    Unified programming model
        Between OS, apps — unification of system
         “objects” and variety of app models
        Between in-process and remote
         interaction — unification of DLLs and RPC
    Binary deployment, connection
        Software pieces or “components” find and
         connect through clearly defined interfaces
    Solves some basic problems of
     integration, independent evolution
Initial COM Principles
   Binary components
       Any programming language
       No centralized authority for dispensing
        names
       Any location (in-proc, x-proc, x-machine)
   Simplest model possible
       Component-managed lifetimes (refcounts)
       Enable extensibility and adaptability
   Zero performance sacrifice for in-proc
   No official “language bindings”
COM Basics
   Servers expose features through
    collections of methods in strongly-
    typed “interfaces”
       Interfaces named with UUIDs
       Implementations named with UUIDs
       Types (categories) named with UUIDs
   Clients call methods as indirect
    functions through “interface pointers”
   Normally, object stateful; methods act it
       New objects created by class factories
Structure of the COM “ORB”
                  Components and Applications

The COM Runtime
                        Core Services
  (Automation, Monikers, Storage, ComCat, Data Transfer, etc.)

        COM and Distributed COM                        Registry

                                                Pluggable Security
                MS-RPC                               (SSPI)

          Pluggable Transports                    NTLM DCE
                                                 Kerberos ETC...
  TCP   UDP   IPX   SPX    HTTP “Falcon”

          SSPI : Security Support Provider Interface
          NTLM : NT LAN Manager
Sketch of COM Architecture
                                        Server                 Surrogate
                  DLL                   (EXE)                      e.g.,
                 Server                                        dllhost.exe
Client of
               Interfaces




                            Boundary




                                                    Boundary
interfaces




                                                    Network
                             Process
                 Foo_1                 Interfaces
                 Foo_2                   Bar_1                    DLL
                                         Bar_2                   Server
                                                               Interfaces
                  DLL                                            Foo_1
                 Server                                          Foo_2
                (Proxy)
               Interfaces              Stub DLL
     DLL         Bar_1                    for
    Server       Bar_2                 Interfaces              Stub DLL
   (Proxy)                               Bar_1                    for
  Interfaces                             Bar_2                 Interfaces
    Foo_1                                                        Foo_1
    Foo_2                                                        Foo_2

                                       DCE-compatible RPC
     COM Peer-to-Peer Model
                        DLL                                         Server




                                  Process/Network
                       Server                        Proxy auto-    Interface
Client of            Interfaces                       created for    Bar_1




                                     Boundary
interfaces             Foo_1                        incoming IP;
                       Foo_2                         receiver can
                                                    start calling
                                                                     Client
    Foo_2 IP as                                                     Interface
     out param                                                       Foo_2
    in Bar_1 call
                    Stub DLL                             DLL
                       for                              Server
      DLL           Interface                          (Proxy)
     Server           Foo_2                           Interface     Stub DLL
    (Proxy)                                             Foo_2          for
   Interface                                                        Interface
     Bar_1                                                            Bar_1
  Proxy to non-COM Servers
                                                    Server




                                                                Process/Network
                       DLL




                                 Process/Network
                      Server                        (EXE)
Client of           Interfaces




                                                                   Boundary
                                    Boundary
interfaces            Foo_1
                      Foo_2                        Interfaces
                                                     Bar_1
                                                     Bar_2
                                                                                  Arbitrary
                      DLL
                     Server                                                       Network
                    (Proxy)                                                       Server or
                   Interfaces                      Stub DLL                        Service
                     Bar_1                            for
      DLL            Bar_2                         Interfaces
     Server                                          Bar_1
   Interfaces
                                                     Bar_2
     Foo_1
     Foo_2
                   Arbitrary wire
                protocol (e.g., HTTP)
                Standard Marshaling
                IUnknown
                                                                 Stub                       IUnknown
                                                                  for
                                                               IUnknown
IMarshal




                                            Process/Network
             Proxy Manager




                                               Boundary
                                                                       Stub          IFoo
            IRPCProxy
                                                                     for IFoo
     IFoo         Proxy                                                                     Server
                 for IFoo                                                            IBar   object

                                                                          Stub
   IBar                                                                 for IBar
                Proxy
               for IBar
                                                                              IRPCStub

                              Channel                         Channel, call
                             object, call                     control, stub
             IRPCChannel       control                          manager
               Custom Marshaling
             IUnknown
                                                                                         IUnknown




                                          Process/Network
           Proxy Manager
                                                                 Stubs




                                             Boundary
                                                                   for            IFoo
                                                               Iunknown,                 Server
   IFoo                                                           IFoo                   object
               Proxy
              for IFoo

                                                                   IRPCStub
                                                                                         IUnknown
  IFoo
                                                                  Magic happens
           Custom Proxy
             for IFoo                                                             IFoo
IMarshal                                                                                 Server
                            Channel                         Channel, call
                                                                                         object
                           object, call                     control, stub
                             control                          manager         IMarshal
           IRPCChannel
Proxy to Proxy Marshaling
                                IFoo
Proxies implement                      Object Bar
IMarshal and create
special objrefs that
connect directly to
server, not to proxy                       IFoo

                                                    Proxy for
           IFoo                                     Object Bar
                  Proxy for                IMarshal
                  Object Bar       IFoo as
                                 out param
         IMarshal                from client              Object Blat

                   Proxy for
                  Object Blat
ActiveX
   OLE corresponding to Internet
   Strategic Technology that integrated
    Web server and client
   COM/DCOM is core of ActiveX
What is OLE ?
   OLE (Object Linking and Embedding) is
    Microsoft's component document
    technology.
       With OLE, it is possible to dynamically link files
        and applications together.
       For instance, an Excel spreadsheet can be
        embedded within a Microsoft Word document
        using OLE. Double clicking the embedded
        spreadsheet will launch Excel and allow the user
        to modify the sheet.
Distributed COM
          Machine A                      Machine B
                            ORPC
          Distributed COM          Distributed COM
    COM                                              COM
             DCE RPC        RPC      DCE RPC



    Using DCE RPC
    Define Interface using MIDL
DCOM Interfaces
   Unique in time and space
   128-bit globally unique identifier (GUID)
       CLSID (Class ID) : unique in component
       IID (Interface ID)
       Utilities for GUID creation : GUIDGEN, UUIDGEN

   defined using MIDL based on DCE IDL
   all interfaces to be derived from a
    special interface called IUnknown : so,
    all components have this interface
DCOM Interfaces (cont’d)
   IUnknown methods
       IUnknown ::QueryInterface : dynamically
        discovering other interfaces supported by an
        object
       IUnknown::AddRef : increasing object’s reference
        count
       Iunknown::Release : when releasing, decrement
        the reference count. If reference count is zero,
        destroy object itself
DCOM Interfaces (cont’d)
   IClassFactory : per CLSID
    IFoo *pfoo = new GoQuux;

    IClassFactory::CreateInstance (0, IID_IFoo,
       (void**)&pfoo);
     IClassFactory::CreateInstance
     IClassFactory::LockServer
        even though there is no objects in
          server, the server lives on memory
MIDL Makes it Easy
   IDL not a necessity, “just” a (very very
    very useful) convenience
   Generated marshaling code packaged
    in proxy/stub COM objects per interface
       Straightforward transformation into pure
        DCE-compatible IDL
       Generated proxies use NDR for
        marshaling, support complex types
   Also generates type library for runtime
    type information (tools)
       Typelibs can also provide marshaling
Exceptions
   All COM methods return HRESULTs
       32/64 value with success/error/info bits
   On error,
           Stub QIs for ISupportErrorInfo (per interface, not
            per object or per method)
           GetErrorObject() as created by callee (today
            from TLS, in future from call object)
           Marshals error object by-value as extent
           On client, proxy unmarshals error object
           Client can QI for ISupportErrorInfo, then same
            dance as stub (GetErrorObject(), etc.)
   VB, MS JVM do this automatically
COM Security
   Supporting launch, access, and call-
    level security
       launch security : activation security of
        sever components
         ACL covering who can launch class
           (EXE or surrogate/DLL)
       access security : access control limiting
        user access to its objects (authorization)
         ACL covering who can access a
           running object in a given process
           (AppID)
COM Security (cont’d)
    call-level security : adjusting
     authentication level of the method
     invocation
      Authenticating, signing, sealing per
        call/connection (same as DCE RPC)
      “Automatic” security: COM enforces
        (per process)
      Or “raw” server-implemented security
        —thread-level auth, impersonation
COM Security (cont’d)
   Offering data integrity through the
    network : protecting data modification
   Offering data privacy against spying
    Supporting impersonation : allowing
    the server to run under the security
    context of the user who activated or
    executed the client process
   Installable security providers
       RPC runtime uses SSPI (GSS-like API)
       Common provider negotiated by COM
       Win NT, (soon) SSL, Kerb providers
GUID




   MAC address + time stamp
GUID (cont’d)

Typedef struct_GUID {
    unsigned long Data1;
    unsigned short Data2;
   unsigned short Data3;
   unsigned char Data4;
} GUID;
  GUID (cont’d)
samplei.h
//{11785220-7D05-11d0-9517-00400539AF9}
DEFINE_GUID (CLSID_Sample, 0x11785220, 0x7d05, 0x11d0,
            0x95, 0x17, 0x0, 0x40, 0x5, 0x39, 0xa6, 0xf9);



sample.cpp
#include<objbase.h>
#include<samplei.h>
                       write program
VTable
   Interface pointer : designate to IpVtable
        created using CoCreateInstance &
         CoCreateInstanceEx
   IpVtable : Address pointer to VTable
   VTable : a series of the first addresses of
    programs                         Server
        Client

Interface Pointer          lpVTable   Function pointer 1
                                      Function pointer 2

                                      Function pointer 3   Object

                                      Function pointer n
COM+
Goals of presentation about
COM+
   Help you understand…
       How COM+ relates to COM, MTS
       How COM+ features fit together
       The implications of using COM+ features
COM+
   At the 1997 Professional Developers Conference in
    San Diego, CA, Microsoft announced plans for
    COM+, an extension to the Component Object Model
    (COM).
   COM+ builds on COM's integrated services and
    features, making it easier for developers to create
    and use software components in any language, using
    any tool.
   Delivered on the Microsoft Windows platform, COM+
    is designed to preserve and extend developers'
    current investments in COM.
Agenda
   Review: COM and MTS Today
   COM+ Architecture
   Extended Calling Models
   Call to Action
Review
COM Architecture

   Object Creation
       In-process
       Remote
   Calling an Interface Method
   Apartments and Threads
Scenario
COM Architecture
main() {
   IAS15Demo* pInt;
   CoInitialize(NULL);
   CoCreateInstance(CLSID_AS15Demo, NULL,
                    CLSCTX_SERVER,
                    IID_IAS15Demo, &pInt);
   pInt->DoSomething();
   …
}
Object Creation
In-Process
                                 Client Process
                                                  Component
       Client
                                                    object   4


          1

                                           5

              COM Runtime
                                                      3
          2
                       SCM                        Registry
                                            {CLSID} Server.DLL
 SCM : Service Control Manager
Object Creation
Remote                           ISurrogate Surrogate Process
                                             Component
    Client
                                                  object     6

          1
                    7
                                                                          5
  COM Runtime                                 COM Runtime

    2           SCM                                              SCM

                                 4
                3
                                                   Registry
              Registry                  {AppID}            DllSurrogate
{AppID}       RemoteServerName
                                        {CLSID}            Server.DLL
Calling An Interface Method
Client Process
                 In-Process         Local Server Process
                 Object

                                     Stub         Local
                 In-Process                       Object
                 Server
 Client
 App                                 COM         Local Server
                              RPC
                   Local
                   Object
                   Proxy


                                      Remote Server Machine
                   Remote
                   Object            Remote Server Process
                   Proxy

                                        Stub       Remote
                  COM         RPC                  Object


                                      COM         Remote Server
    Apartments And Threads
                  Process
                                        STA
                            STA                      MTA



STA :
single threaded
apartment
                  Process
                                  STA               MTA




         Apartments : objects with different concurrency semantics into
         distinct execution contexts
Review
MTS Architecture

   Object Creation
       From base client
       From component
   Calling an Interface Method
What is Microsoft
Transaction Server?
    A runtime for building scalable server/
     mid-tier applications
    A pragmatic combination of
        Distributed component and transaction
         processing technology
    An enabler of high-performance 3-tier
     client/server computing
        Vastly simplifies common server tasks
        Provides good performance on server
         without explicit multi-threading
What is MTS?…
   Distributed Transaction Coordinator
       DTC coordinates transactions across
        heterogeneous resources
   Runtime (MTX.DLL) and surrogate
    (MTX.EXE) for COM components
       Automatic transactions; automatic
        security roles; JIT activation
   An administration tool (MTS Explorer)
    and management infrastructure
MTSScenario: MTS
Architecture
Base Client
Main() {
   IAS15Demo* pInt;
   CoInitialize(NULL);
   CoCreateInstance(CLSID_AS15Demo, NULL,
                    CLSCTX_SERVER,
                    IID_IAS15Demo, &pInt);
   pInt->CreateSubObject();
   …
}
Scenario: MTS Architecture
Component
CAS15DemoImpl::CreateSubObject() {
   IObjectContext* pCtx;
   IAS15DemoSub*   pSub;
   GetObjectContext(&pCtx);
   pCtx->CreateInstance(CLSID_AS15DemoSub,
                         IID_IAS15DemoSub, &pSub);
   pSub->DoSomethingElse();
   …
}
Object Creation
From Base Client
                             MTS Surrogate
                             4                  5
   Client
                       MTS Executive      Component
               9            Context
                            wrapper
                                Object
   1                   8
                                context

              6             Class            Class
                           factory           object
                           wrapper

                   7
                                          3
       COM Runtime
                                    Registry
        2    SCM              {CLSID} MTX {package}
Object Creation Scenario
1. Client calls CoCreateInstance
2. Find server
3. Launch MTS Surrogate
4. Load MTS Executive
5. Load Component
6. Get class object
7. Create object
8. Create context
9. Interface pointer returned to client (client thinks it’s to
     real object)
   NOTE: real object not yet created. Object will be created on first
    method call, thanks to MTS just-in-time activation
Object Creation
More about Context
                               MTS Surrogate
   Object context

       Creator ID        MTS Executive      Component
        Activity              Context
      Transaction             wrapper
   Security Properties            Object
                                  context

                             Class             Class
                            factory            object
                            wrapper


   MTS Catalog
Object Creation
From Component
                     MTS Surrogate Process
   Component                MTS Executive          Sub Component
                                   Context
    Object                         wrapper
                        4
                                         Object
      1                                  context

                        2   3
    Object Context
                                                        Class
                                   Class factory        object
                                     wrapper




                     MTS Catalog
Calling An Interface Method

               MTS Surrogate Process
 Client       MTS Executive           Component
          1         Context
                    wrapper
                                  3      Object



              Object
              context         2          Class
                                         object
COM+ Architecture
   What is COM+?
   Concepts
   Activation
   Interception
   Services
What Is COM+?
   Unification of COM and MTS
   Plus...
       Extensions to base COM
       Extensions to MTS services
       New Services
   Minimal impact on how you
    write components
   Remoting architecture doesn’t
    change (DCOM)
Applications And Classes
   COM+ Applications
       Evolution of MTS Packages
       Library applications run in-process
       Server applications run in COM+ surrogate
   COM+ Classes
       Configured classes
         Installed in application
         Can use COM+ Services
       Unconfigured classes
         Everything else...
COM+ Thread Types
   Single-Threaded Apartment (STA)
       Synchronized using windows messages
       Call that leaves thread causes message
        loop to execute
   Multi-Threaded Apartment (MTA)
       No synchronization
       Call leaving thread blocks further
        execution on thread
       RPC worker threads are this type
COM+ Apartment Types
   Apartment
       Collection of objects and their contexts
   Single-Threaded
       Objects execute on STA thread where they
        were created
   Multi-Threaded
       Objects execute on any MTA thread
   Neutral (New!)
       Objects execute on caller’s thread type
Apartment Assignment
 Creator’s Apartment                             Class’s ThreadingModel Key
       Model            Apartment             Free            Both        Neutral     Not Specified
  Single-      Not     Created in       Created in        Created in    Created in   Created in
 Threaded     “Main”   Current          Multi-Threaded Current          Neutral      “Main” Single-
                       Apartment        Apartment         Apartment     Apartment    Threaded
                                                                                     Apartment
              “Main”   Created in       Created in       Created in     Created in   Created in
                       Current          Multi-Threaded   Current        Neutral      Current
                       Apartment        Apartment        Apartment      Apartment    Apartment

   Multi-Threaded      Created in       Created in       Created in     Created in   Created in
                       “Host” Single-   Multi-Threaded   Multi-         Neutral      “Main” Single-
                       Threaded         Apartment        Threaded       Apartment    Threaded
                       Apartment                         Apartment                   Apartment
  Neutral (on STA      Created in       Created in       Created in     Created in   Created in
     Thread)           Single-          Multi-Threaded   Neutral        Neutral      “Main” Single-
                       Threaded         Apartment        Apartment      Apartment    Threaded
                       Apartment for                                                 Apartment
                       this thread
  Neutral (on MTA      Created in       Created in       Created in     Created in   Created in
     Thread)           “Host” Single-   Multi-Threaded   Neutral        Neutral      “Main” Single-
                       Threaded         Apartment        Apartment      Apartment    Threaded
                       Apartment                                                     Apartment
Marshaling Requirements
 Caller’s Apartment Model                        Destination Apartment Model
                                 Single-Threaded          Multi-Threaded         Neutral
Single-Threaded             In same apartment and        Marshaled to an Marshaled then
                            context, call is direct,     MTA thread      executed on this
                            otherwise marshaled to                       thread
                            destination apartment’s
                            thread
Multi-Threaded              Marshaled to destination Call is Direct if   Marshaled then
                            apartment’s thread           in same context executed on this
                                                         otherwise       thread
                                                         Marshaled then
                                                         executed on
                                                         this thread
Neutral (on STA Thread)     Marshaled and executed Marshaled to an Call is Direct if in
                            on destination               MTA thread      same context
                            apartment’s thread (may                      otherwise Marshaled
                            not require thread                           then executed on
                            switch)                                      this thread
Neutral (on MTA Thread)     Marshaled to destination Marshaled and Call is Direct if in
                            apartment’s thread           then executed   same context
                                                         on this thread  otherwise Marshaled
                                                                         then executed on
                                                                         this thread
COM+ Domains
   Independent aspects of an
    execution environment
   Objects with same aspect
    share a domain
         Locality (machine, process, apartment)
         Service specific (e.g. transaction T1,…)
   Arbitrarily intersect and nest
COM+ Context
   An intersection of domains
       Boundary around objects sharing the
        same properties
   Every object lives in a context
       Non-default context
         Objects from configured classes
       Default context
         Objects from unconfigured classes

   The basis for COM+ Services
Domains And Contexts




Process

Apartment


Context

Domain
Scenario: COM+ Class
Base Client
Main() {
   IAS15Demo* pInt;
   CoInitialize(NULL);
   CoCreateInstance(CLSID_AS15Demo, NULL,
                    CLSCTX_SERVER,
                    IID_IAS15Demo, &pInt);
   pInt->CreateSubObject();
   …
}
Scenario: COM+ Class
Component
CAS15DemoImpl::CreateSubObject() {
   // IObjectContext* pCtx;
   IAS15DemoSub*   pSub;
   // GetObjectContext(&pCtx);
   // pCtx->CreateInstance(CLSID_AS15DemoSub,
   //                      IID_IAS15DemoSub, &pSub);
   CoCreateInstance(CLSID_AS15DemoSub, NULL,
                    CLSCTX_SERVER,
                    IID_IAS15DemoSub, &pSub);
   pSub->DoSomethingElse();
   …                                 No special creation API
}                                    required. Context flows
                                             automatically
Activation
From Base Client, In-Process
  Client Process
                                            Context
       Client
                                  Component
                                  object

         1

                             6     4            5
   COM+ Runtime

   2
             Activator           Catalog
                         3
                                 Registry    RegDB
Activation
Remote                   ISurrogate Surrogate Process

                                  Component
      Client
                                    object



         1     6
                                               5
COM+ Runtime                              COM+ Runtime
 2           3                     4
  Activator                        Activator



               Catalog                             Catalog
COM+ Catalog
   Unifies and extends COM,
    MTS registration
   Activator queries Catalog
   Catalog supports two data stores
       Registry (HKCR) for unconfigured classes
       RegDB for configured classes
   RegDB populated from…
       Meta-data in self-describing components
       Administrative tools
Self-Describing Component
   Type library (TLB)
       Class, interface, method signatures
   Component Library (CLB)
       Attributes and registration information
         Transaction, Synchronization,
           Queueable, Loadbalanceable, Roles
         ThreadingModel, Component
           Categories, FileExt
   Requires Developer Tool Support
       IMetaDataEmit/IMetaDataImport
Activators
   Extensible architecture for
    object creation
   Activator chain determines...
       Object location
       Context properties
   COM+ provides system activators and
    defines chain order
Activator Chain
Client                                            Server
Process                                           Process


                           Machine
                           Activators
              Process
              Activators




              Context
              Activators

                                                   B
                                        Server
          A
                                        Context
Context Revisited
   Context contains a set of
    context properties
   Context properties can flow from client
    to new object’s context
   Once initialized, context is immutable
Activation
From Component

   Component                COM+ Runtime
                            2
                 1              Activator
    Object                                   4
                        3                        Prototype
                                                  Context
                                                 Properties

                                   Catalog


   Context Properties
Activation
From Component

   Component                        COM+ Runtime
                                    2
               1                        Activator
    Object                                           4
               Context Properties
                                    3
                                                          Context
                                                         Identical
   6a
                                           Catalog

             Sub Object


                          5a
         Sub Component
  Activation
  From Component

             Component                         COM+ Runtime
                                               2
                          1                        Activator
               Object                                           4
                          Context Properties
                                               3
                                                                    Context
                                                                    Different
            6b
                                                      Catalog



Context Properties      Sub Object   5b
                       Sub
                     Component
Interception
Calling an interface method

   Context C1                     Context C2
                Proxy      Stub
                                  (Cross Apartment or Process)


      A                                 B      (Same Apartment)


    Client                          Server
      Side       Pass Buffer        Side
   Policies                         Policies
        Call,                       Enter,
      Return     Pass Buffer        Leave
Policy Makers
   Correspond to context properties
   Used to build a policy set for cross-
    context calls
       Each policy maker in both contexts can
        contribute policies to policy set
       Created on first unmarshal of reference
        between contexts
Policy Sets
   Every cross-context reference has a
    policy set
       One policy set shared by all references
        between C1, C2
   Policy set reflects difference between
    C1, C2
   Cross-context calls deliver policy
    events to each of the policies in the
    policy set
   Policies are composable
Policy Objects
   Policy object provides
    domain semantics
   Cross-context calls deliver
    policy events
       Client: call/return; Server: enter/leave
       May pass buffer to cohort policy
   Policy objects sink policy events
   Example: Synchronization policy
       onEnter: acquire mutex
       onLeave: release mutex
Activation And Interception
Recap

   During instance creation
       Activators for clsid determine new object’s
        location and context properties
   During object reference unmarshaling
       Context properties, as policy makers, may
        add policy objects to the ref’s policy set
   During call
       COM+ delivers policy events to policies
       Policies implement domain semantics
COM+ Services
   Build on unified architecture
   Lots of PDC talks on Services…
       AS12, AS13 -- Services Overview
       AS09 -- Security
       AS16 -- Object Pooling
       AS07 -- Events
       AS08 -- Load Balancing
       AS10 -- Queued Components
       AS11 -- In-Memory Database
       AS06 -- Deployment, Administration
Extended Calling Models
   COM has always been synchronous,
    connected, tightly-coupled
   COM+ extends your options
       Asynchronous
         Non-blocking calls
         Queued Components (MSMQ)  AS10
       Events  AS07
       Pipes
       Light-weight handlers
Non-Blocking Method Calls
What it is

   Formerly known as “async COM”
   Unconfigured classes only!
   Client and server are connected
   Two Models
       “Fire and Forget”
       “Call/Reply”
   MIDL automatically generates async
    interface for you
       Triggered by ASYNC_UUID on interface
Non-Blocking Method Calls
How it works

                                   Component
                        IAS15Demo
   Client       1       ICallFactory   object


                                                2
            3   6   AsyncIAS15Demo
                                        call
                       ISynchronize    object
                5
                                                4
 Synchronization Objects
      ISynchronize   CLSID_                  ISynchronize::Signal {
                     StdEvent                    SetEvent
ISynchronizeHandle
                                             }
 ISynchronizeEvent
                           User-supplied
                            Win32 event      ISynchronize::Reset {
                                                 ResetEvent
      ISynchronize   CLSID_                  }
                     ManualReset
ISynchronizeHandle                           ISynchronize::Wait {
                     Event
ISynchronizeEvent
                                                 CoWaitForMultipleHandles
                         Unamed Win32
                        manual reset event
                                             }
                                                       Maintains COM
                        CLSID_                           threading
ISynchronizeContainer                                   guarantees
                        Synchronize
                        Container
Call Cancellation
Client Process                       Server Process

                                                      Object
                                       Stub
 Client                          5
 App          1                                       Component
                         Proxy

              4   ICMC                         6
                            2
          3
                  COM                 COM


 ICMC = ICancelMethodCalls
Data Transfer With Pipes
   Allows large amount or late-produced
    data transfer
       Similar to DCE/RPC pipes
   New Interfaces
       IPipeByte, IPipeLong, IPipeDouble
         Pull obtains data from pipe source
         Push supplies data to pipe source

   Supports Non-Blocking method calls
Pipes
Client Process               Server Process

                                       IPipeXXX
                                                  Object
                               Stub
 Client             Pipe-
 App       IPipeXXX Aware     COM                 Component
                    Proxy




                            Proxy reads ahead
                            and writes behind
                            using async calls
                 COM
Light-Weight Handlers
   Allow server to specify
    client-side handler
       Useful for special processing
       Server and client are connected
         Unlike OLE Default handler that
          activates server when needed
   Existing interface
       IStdMarshalInfo::GetClassForHandler
   New API
       CoGetStandardMarshalEx
 Light-weight Handlers

IMultiQI                                   IAS15Demo
               Identity
                                                          Object

           IMultiQI                            IStdMarshalInfo
IAS15Demo               Handler
                                                         Stub
             IMultiQI                                   Manager
  IMarshal                Proxy
                         Manager
                                                             Interface Stub

                                                                 Stub
    IAS15Demo            Interface Proxy


                Proxy Object                                Server
Summary
   COM+ unifies COM and MTS
       Extensible activation architecture
       Extensible interception architecture
   COM+ extends COM and MTS
       Services build on unified architecture
Questions?
References
   Books
       Chappell. Understanding ActiveX and OLE
       Eddon. Inside DCOM
       Grimes. Professional DCOM
       Box. Essential COM
   COM Home Page
       http://www.microsoft.com/com/
   Windows NT 5.0 Platform SDK
       Beta 2 or later