How to Implement the DLL Infrastructure

If you dump the named exports of a DLL that contains in-process COM objects, you usually see very few exported functions and none of the methods associated with the COM objects. The reason is that COM objects and their methods are not exported as they would be with a conventional DLL. One way of looking at COM, in fact, is that it is a different and more structured way to provide access to a DLL’s methods.

To manage the process, the DLL must expose some basic infrastructure. The infrastructure has three basic components:

  • A DllMain function that provides an entry point for the DLL.

  • One or more class factories that external clients use to create instances of COM objects in the DLL.

  • A DllGetClassObject function, ...

Get Developing Drivers with the Windows® Driver Foundation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.