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.

49 lines
1.5 KiB

  1. //
  2. // DWNSOCK2.INC Macros for dynamically linking to WinSock 2
  3. //
  4. #if ((! defined(DPNBUILD_ONLYWINSOCK2)) && (! defined(DPNBUILD_NOWINSOCK2)))
  5. #ifdef DWINSOCK_GLOBAL
  6. #undef DYNAMICWINSOCK
  7. #define DYNAMICWINSOCK(name, ptr) ptr p_##name
  8. #endif // DWINSOCK_GLOBAL
  9. #ifdef DWINSOCK_EXTERN
  10. #undef DYNAMICWINSOCK
  11. #define DYNAMICWINSOCK(name, ptr) extern ptr p_##name
  12. #endif // DWINSOCK_EXTERN
  13. #ifdef DWINSOCK_GETPROCADDRESS
  14. #undef DYNAMICWINSOCK
  15. #define DYNAMICWINSOCK(name, ptr) \
  16. p_##name = (ptr)GetProcAddress(g_hWinSock2, #name); \
  17. if (p_##name == NULL) fOK = FALSE
  18. #endif // DWINSOCK_GETPROCADDRESS
  19. DYNAMICWINSOCK(WSAGetOverlappedResult, LPFN_WSAGETOVERLAPPEDRESULT);
  20. DYNAMICWINSOCK(WSAIoctl, LPFN_WSAIOCTL);
  21. DYNAMICWINSOCK(WSARecvFrom, LPFN_WSARECVFROM);
  22. DYNAMICWINSOCK(WSASendTo, LPFN_WSASENDTO);
  23. #ifdef UNICODE
  24. DYNAMICWINSOCK(WSAEnumProtocolsW, LPFN_WSAENUMPROTOCOLSW);
  25. #else // ! UNICODE
  26. DYNAMICWINSOCK(WSAEnumProtocolsA, LPFN_WSAENUMPROTOCOLSA);
  27. #endif // ! UNICODE
  28. #else // DPNBUILD_ONLYWINSOCK2 or DPNBUILD_NOWINSOCK2
  29. #ifdef DPNBUILD_ONLYWINSOCK2
  30. #define p_WSAGetOverlappedResult WSAGetOverlappedResult
  31. #define p_WSAIoctl WSAIoctl
  32. #define p_WSARecvFrom WSARecvFrom
  33. #define p_WSASendTo WSASendTo
  34. #ifdef UNICODE
  35. #define p_WSAEnumProtocolsW WSAEnumProtocolsW
  36. #else // ! UNICODE
  37. #define p_WSAEnumProtocolsA WSAEnumProtocolsA
  38. #endif // ! UNICODE
  39. #endif // DPNBUILD_ONLYWINSOCK2
  40. #endif // DPNBUILD_ONLYWINSOCK2 or DPNBUILD_NOWINSOCK2