CoClass ObjCreator

The CoClass ObjCreator implements a set of methods that programming languages like Visual Basic can use to indirectly call CoCreateInstanceEx and be able to specify the target machine they desire an instance of an object to run on.  This is in contrast to the VB function CreateObject that only connects to the host specified under the AppID for the target coclass.  This object also provides a separate method that implements a standard Security Support Provider Interface (SSPI) handshake between a client application and a requested COM object implemented to work with the ObjCreator object using the NTLM security support provider (SSP). This process is completely analogous to the SSPI handshake that Distributed COM (DCOM) uses when providing authentication information about clients to COM objects that are either out-of-process or remote. 

COM Class Identifiers

     Programmatic Identifier ObjCreator.ObjCreator.1
CLSID {C9C419D1-8B6A-11D0-BCD9-00805FCCCE04}
Logical Name ObjCreator Class
Type Library c:\winnt\system32\objcreator.dll (resourse in DLL)
Threading Model "Both"

COM Interfaces Implemented

IUnknown

the standard base COM interface.

IDispatch

the standard Automation COM interface.

IObjCreator

IID C9C419D0-8B6A-11D0-BCD9-00805FCCCE04
Type Library
c:\winnt\system32\objcreator.dll
    This dual interface defines two methods for requesting the services of COM classes either on a local or remote machine. The CreateObj method allows creation of objects with a particular Programmatic Identifier on the host specified, via DCOM. The CreateObjAuth does the same, but forces a two-way SSPI handshake to authenticate the requesting client to the target object. If the newly created object is satisfied that the client requesting its services has sufficient credentials, the object will allow the client to invoke the set of protected methods. If the credentials are not sufficient, the client will only be able to execute methods that do not require special privilege by the target object.
HRESULT  CreateObj (
    [in]            BSTR      bstrProgId, // programmatic ID of coclass
    [in, optional]  BSTR      bstrServer, // remote server name
    [out, retval]   VARIANT  *pVarObject  // if successful, VT_DISPATCH
);
HRESULT  CreateObjAuth (
    [in]            BSTR      bstrProgId, // progID of coclass
    [in, optional]  BSTR      bstrServer, // remote server name
    [out, retval]   VARIANT   *pVarObject // if successful, VT_DISPATCH
);

     In each case, the user specifies the ProgID of the class desired, and optionally, the name of the server to create the object on. If no server name is given, the name localhost” is assumed.  The method then populates the third, (or second if no server name is specified) argument with the IDispatch interface address of the requested object. In CreateObjAuth, if the authentication handshake was not successful with the target object, the HRESULT value S_FALSE is returned.

Note   The use of CreateObjAuth is restricted to creating COM objects that have been implemented strictly for use with the ObjCreator. The SSPI handshake will not occur if the target object has not been implemented to work with this coclass.


IObjCreatorAuth

IID 0B63E394-9CCC-11D0-BCDB-00805FCCCE04
Type Library
c:\winnt\system32\objcreator.dll
     This interface provides a pure COM interface for C/C++ or pointer-enabled client applications. In this case, there is only one method, and it performs the same function as IObjCreator::CreateObjectAuth above. However, one must supply the CLSID of the coclass desired, rather than the programmatic identifier. Similarly, the IUnknown interface address is returned in the third argument. This method performs a custom SSPI handshake to establish the credentials of the calling client process to the target coclass instance. If the authentication was not successful, the method returns the HRESULT value S_FALSE, If successful, S_OK. In either case, the IUnknown address is returned on an instance of the requested COM object or a standard HRESULT exception is returned.
HRESULT CreateClsObjAuth(
     [in]    GUID*      rClsid, // the CLSID for the class desired
     [in]    BSTR       bstrServer, // the server to run object on
     [out]   IUnknown** ppUnknown   // if successful, the IUnknown 
);

Remarks

Note   This interface and method are designed strictly for creating instances of COM objects that have been implemented to work specifically with the ObjCreator coclass.  One cannot use this interface or method to create arbitrary COM objects



© 1997-1998 Microsoft Corporation. All rights reserved.