Failure Hooks
The failure hook is enabled in the same manner as the notification hook. The pointer variable that refers to the user-defined function is:
// This is the failure hook, dliNotify = {dliFailLoadLib|dliFailGetProc}
#if defined(__cplusplus)
extern "C"
#endif
extern
PfnDliHook __pfnDliFailureHook;
The DelayLoadInfo structure contains all the pertinent data necessary for accurate reporting of the error, including the value from GetLastError.