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.

44 lines
1.2 KiB

  1. #include <windows.h>
  2. #include <delayimp.h>
  3. ////////////////////////////////////////////////////////////////////////////////
  4. static VOID* WINAPI hook_NULL()
  5. {
  6. SetLastError( ERROR_PROC_NOT_FOUND );
  7. return NULL;
  8. }
  9. static DWORD WINAPI hook_NOTFOUND()
  10. {
  11. return ERROR_PROC_NOT_FOUND;
  12. }
  13. ////////////////////////////////////////////////////////////////////////////////
  14. FARPROC WINAPI HELPCTR_DelayLoadFailureHook( UINT unReason, PDelayLoadInfo pDelayInfo )
  15. {
  16. if(!lstrcmpiA( pDelayInfo->szDll, "iphlpapi.dll" ) ||
  17. !lstrcmpiA( pDelayInfo->szDll, "rasapi32.dll" ) )
  18. {
  19. // IPHLPAPI.DLL :: GetAdaptersInfo
  20. // RASAPI32.DLL :: RasEnumEntriesW
  21. return (FARPROC)hook_NOTFOUND;
  22. }
  23. // COMDLG32.DLL :: PrintDlgW
  24. // CRYPT32.DLL :: CryptBinaryToString
  25. // USERENV.DLL :: GetProfileType
  26. // WINSPOOL.DRV :: ClosePrinter
  27. // WINSPOOL.DRV :: EndDocPrinter
  28. // WINSPOOL.DRV :: EndPagePrinter
  29. // WINSPOOL.DRV :: OpenPrinterW
  30. // WINSPOOL.DRV :: StartDocPrinterW
  31. // WINSPOOL.DRV :: StartPagePrinter
  32. // WINSPOOL.DRV :: WritePrinter
  33. return (FARPROC)hook_NULL; // Also covers hook_ZERO and hook_FALSE.
  34. }
  35. // we assume DELAYLOAD_VERSION >= 0x0200
  36. PfnDliHook __pfnDliFailureHook2 = HELPCTR_DelayLoadFailureHook;