We can't just run ATLDept since it's a DLL. Instead we use a surrogate provided by DCOM. This is a program called
and is installed by default in your Dllhost.exe
directory during installation of DCOM for Windows 95. The operation of the surrogate process is quite straightforward: it simply creates a process space for the DLL server to execute in. It aggregates all of the DLL's interfaces and exposes them to any remote clients.\Windows\System
The command line syntax for invoking the surrogate is:
DLLHOST <clsid>
For example, we can host the
by specifying the class id of the ATLDept class. (Note: one easy way to get the class id is to use Object Viewer, select the class and choose the Object menu, selecting the Copy CLSID to the clipboard option).ATLDept.dll
DLLHOST {D2A1CBC6-4C5E-11D0-8564-004005263AF7}
This will start the surrogate process waiting for DCOM calls on behalf of the
server. If you examine the Implementation tab of the right pane of the Object Viewer display with the Inproc Server tab selected, you'll also see a space for specifying the surrogate process:ATLDept.dll
The entry here is rather useless under Windows 95. Under Windows NT, if you specify an entry here, the 'automatic launching' service can launch the
surrogate with the Dllhost.exe
whenever a client call is received remotely. On the other hand, starting such a surrogate must be performed manually on Windows 95. What's more interesting, if you were to instantiate ATLDept from Object Viewer, it would simply call the in-proc server directly without going through the expensive surrogate process.ATLDept.dll