Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
785 B

  1. #include <windows.h>
  2. #include <delayimp.h>
  3. ////////////////////////////////////////////////////////////////////////////////
  4. static HRESULT WINAPI hook_HRESULT()
  5. {
  6. return HRESULT_FROM_WIN32( ERROR_PROC_NOT_FOUND );
  7. }
  8. static VOID* WINAPI hook_NULL()
  9. {
  10. SetLastError( ERROR_PROC_NOT_FOUND );
  11. return NULL;
  12. }
  13. ////////////////////////////////////////////////////////////////////////////////
  14. FARPROC WINAPI HELPHOST_DelayLoadFailureHook( UINT unReason, PDelayLoadInfo pDelayInfo )
  15. {
  16. if(!lstrcmpiA( pDelayInfo->szDll, "shell32.dll" ))
  17. {
  18. return (FARPROC)hook_HRESULT;
  19. }
  20. // WININET.dll
  21. // URLMON.dll
  22. return (FARPROC)hook_NULL; // Also covers hook_ZERO and hook_FALSE.
  23. }
  24. // we assume DELAYLOAD_VERSION >= 0x0200
  25. PfnDliHook __pfnDliFailureHook2 = HELPHOST_DelayLoadFailureHook;