A forum for reverse engineering, OS internals and malware analysis 

Ask your beginner questions here.
 #24232  by Vrtule
 Mon Oct 27, 2014 8:55 am
Carlbyte wrote:IRP worked perfectly! The system displays a message invalid file and does not load the file. Worked for EXE, DLL and SYS and did not stop the exe worked in the case of dll. So who are looking for this information, use IRP instead of PsSetLoadImageNotifyRoutine.
Happy to hear it worked!

As PsSetLoadImageNotifyRoutine may suggest, it registers a NOTIFY callback, meaning that the callback is called to NOTIFY your driver about an image loaded. Notifying does not necessarily mean there is a documented way of blocking the event at that point.