If you allocate memory in your plugin’s DLLMain entry point, it must deallocate that memory when DLLMain is called with DLL_PROCESS_DETACH. Your plugin can run some initialization code in DLLMain, such as allocating memory, before its PluginMain function is called by Acrobat or Adobe Reader. The LoadLibrary function calls your plugin’s DLLMain entry point with the parameter DLL_PROCESS_ATTACH passed. Acrobat or Adobe Reader loads the plugin by invoking the LoadLibrary function and then calls the function referenced by the PlugInMain symbol. When it locates a file with the extension.API, it looks for the PlugInMain exported symbol, which specifies the entry point for your plugin. Acrobat or Adobe Reader also searches nested directories, allowing you to group plugins in folders. When Acrobat or Adobe Reader starts, it scans the plugins folder (in the same directory as the Acrobat executable) for DLLs with the extension.API.