DLLProc is used to specify a procedure that is invoked every time a DLL's entry point is called. A procedure assigned to DLLProc must take one parameter of type Integer or int. For example,
- procedure LibraryProc(Reason: Integer); { Delphi }
- void LibraryProc(int Reason); // C++
- When the procedure is invoked, this single parameter contains a value between 0 and 3 as defined by the following group of constants (from the Windows unit):
- const
- DLL_PROCESS_DETACH = 0;
- DLL_PROCESS_ATTACH = 1;
- DLL_THREAD_ATTACH = 2;
- DLL_THREAD_DETACH = 3;
- For further details on the meaning of these constants, refer to the description of the DllEntryPoint function in the Win32 API online help.
Note: DLL_PROCESS_ATTACH is passed to the procedure only if the DLL's initialization code calls the procedure and specifies DLL_PROCESS_ATTACH as a parameter.
Note: When the Reason parameter is DLL_PROCESS_ATTACH, setting
ExitCode to a nonzero value causes the entry point to return false.