Leaked source code of windows server 2003
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.

29 lines
993 B

  1. // Override the linkers default behaviour to DELAYLOAD failures. Instead of throwing an exception
  2. // try and return a function that simulates a failure in that API, therefore allowing the caller
  3. // to correctly handle it.
  4. //
  5. // To use this functionality exactly one source must include this with COMPILE_DELAYLOAD_STUBS defined,
  6. // and link to shlwapi.
  7. #ifdef __cplusplus
  8. extern "C" { // Assume C declarations for C++
  9. #endif // __cplusplus
  10. #ifdef COMPILE_DELAYLOAD_STUBS
  11. #include "delayimp.h"
  12. // NOTE: The names __pfnDliNotifyHook / __pfnDliFailureHook must not be changed,
  13. // NOTE: as they are referenced by the linker's DELAYLOAD handler so we can hook
  14. // NOTE: and process failures during symbol import.
  15. FARPROC WINAPI ShellDelayLoadHelper(UINT unReason, PDelayLoadInfo pInfo);
  16. PfnDliHook __pfnDliNotifyHook = ShellDelayLoadHelper;
  17. PfnDliHook __pfnDliFailureHook = ShellDelayLoadHelper;
  18. #endif
  19. #ifdef __cplusplus
  20. }
  21. #endif // __cplusplus