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.

64 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 2002 Microsoft Corporation
  3. Module Name:
  4. ISA2.cpp
  5. Abstract:
  6. The ISA setup needs to successfully open the SharedAccess service and get the
  7. its status in order to succeed. But on whistler we remove this from advanced
  8. server since it's a consumer feature so the ISA setup bails out.
  9. We fake the service API call return values to make the ISA setup happy.
  10. History:
  11. 06/20/2002 linstev Created
  12. --*/
  13. #include "precomp.h"
  14. IMPLEMENT_SHIM_BEGIN(ISA2)
  15. #include "ShimHookMacro.h"
  16. APIHOOK_ENUM_BEGIN
  17. APIHOOK_ENUM_ENTRY(WSAGetLastError)
  18. APIHOOK_ENUM_END
  19. typedef int (WINAPI *_pfn_WSAGetLastError)();
  20. /*++
  21. Return WSAEADDRINUSE instead of WSAEACCES.
  22. --*/
  23. int
  24. APIHOOK(WSAGetLastError)()
  25. {
  26. int iRet = ORIGINAL_API(WSAGetLastError)();
  27. if (iRet == WSAEACCES) {
  28. iRet = WSAEADDRINUSE;
  29. }
  30. return iRet;
  31. }
  32. /*++
  33. Register hooked functions
  34. --*/
  35. HOOK_BEGIN
  36. APIHOOK_ENTRY(WS2_32.DLL, WSAGetLastError)
  37. HOOK_END
  38. IMPLEMENT_SHIM_END