Page 1 of 1

DLLmain - missing procedure

Posted: Mon Mar 02, 2026 11:38 am
by Garfield
I noticed there is one procedure missing.

In help file:
For advanced programmers: there is 4 special procedures which are called automatically by the OS when one of the following events happen:

- DLL is attached to a new process
- DLL is detached from a process
- DLL is attached to a new thread
- DLL is detached from a thread

To handle that, it's possible to declare 4 special procedures called: AttachProcess(Instance), DetachProcess(Instance), AttachThread(Instance) and DetachThread(Instance). This means these 4 procedures names are reserved and can't be used by the programmer for other purposes.
Yes, that's all right. But a 5th procedure/option is missing. It should be:

PROCESS_VERIFIER. It's used by windows for IFEO settings.
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sample.exe
entries GlobalFlag and VerifierDlls

additonal informations:
https://scorpiosoftware.net/2024/06/01/ ... ifier-dll/
https://github.com/zodiacon/VerifierDLL ... llmain.cpp

Re: DLLmain - missing procedure

Posted: Tue Mar 10, 2026 8:30 pm
by Quin
+1

Re: DLLmain - missing procedure

Posted: Tue Mar 10, 2026 9:30 pm
by fryquez
And what would be the use? VerifierDlls are only allowed to link against ntdll.dll, so you can't create one with Purebasic.