Surrogate Sharing

DLL servers will share a surrogate if they have matching security identities and share the same AppID value.

DLL servers are loaded, by default, into their own surrogate process. To load other DLL servers into an existing surrogate, so it supports more than one DLL servers, there are two requirements:

  1. The DLL servers must have the same AppID value.
  2. The security context of the DLL servers must be the same.

If two dll servers are to be launched under different security identities, they must be in different surrogates, regardless of whether or not their AppID's match.

Following is an example of administering surrogate sharing with AppIDs:

AppID
        {12345678-0000-0000-0000-abcdabcdabcd}
            @DllSurrogate    REG_SZ
    CLSID
        {12345678-0000-0000-0000-000000000001}
            @AppId    REG_SZ    {12345678-0000-0000-0000-abcdabcdabcd}
            InProcServer32
    @    REG_SZ    c:\myapp\comp1.dll
        {12345678-0000-0000-0000-000000000002}
            @AppId    REG_SZ    {12345678-0000-0000-0000-abcdabcdabcd}
            InProcServer32
    @    REG_SZ    c:\myapp\comp2.dll
 

The two CLSIDs for DLL components comp1.dll and comp2.dll have been configured to share an AppID. The AppID specifies that the DLL server can be loaded in a surrogate by specifying the DllSurrogate named-value. In this example the DllSurrogate named-value is an empty string, indicating that the default system implementation of the DLL surrogate should be used.