Using the DLL Notification Entry Point

The DLL notification entry point allows a DLL to be informed every time a process attaches to, or detaches from, the DLL, or a process attached to the DLL creates or destroys a thread. To implement a DLL notification entry point, you must code a function in your DLL, based on the DLLEntryPoint prototype function.

BOOL DLLEntryPoint(HINSTANCE hInstDLL, DWORD dwNotification, LPVOID lpReserved);

The function name DLLEntryPoint is simply a placeholder. By default the linker looks for a function with the name DLLMain. You can name the function anything you want if you specify the DLL entry point. This is typically done by using an /entry switch on the linker command line, as shown in the following code segment: ...

Get Microsoft Windows 2000 API SuperBible 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.