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.

119 lines
2.1 KiB

  1. #ifndef _DSLOOKUP_H
  2. #define _DSLOOKUP_H
  3. #include <ipexport.h>
  4. #include <Winsock2.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. #ifdef DBG
  9. LPVOID
  10. RSPAlloc(
  11. DWORD dwSize,
  12. DWORD dwLine,
  13. PSTR pszFile
  14. );
  15. #else
  16. LPVOID
  17. RSPAlloc(
  18. DWORD dwSize
  19. );
  20. #endif
  21. void
  22. DrvFree(
  23. LPVOID p
  24. );
  25. #if DBG
  26. #define DrvAlloc(x) RSPAlloc(x, __LINE__, __FILE__)
  27. #else
  28. #define DrvAlloc(x) RSPAlloc(x)
  29. #endif
  30. #if DBG
  31. #define DBGOUT(arg) DbgPrt arg
  32. VOID
  33. DbgPrt(
  34. IN DWORD dwDbgLevel,
  35. IN PUCHAR DbgMessage,
  36. IN ...
  37. );
  38. #else
  39. #define DBGOUT(arg)
  40. #endif
  41. BOOL OpenServerLookup(HKEY hRegistry);
  42. BOOL GetNextServer(LPSTR pszServerName, DWORD dwSize, BOOL * pbFromReg);
  43. BOOL CloseLookup(void);
  44. typedef int (WSAAPI * PFNWSASTARTUP)(
  45. WORD wVersionRequested,
  46. LPWSADATA lpWSAData
  47. );
  48. typedef int (WSAAPI * PFNWSACLEANUP)(
  49. VOID
  50. );
  51. typedef HOSTENT FAR * (WSAAPI * PFNGETHOSTBYNAME)(
  52. const char FAR *name
  53. );
  54. typedef HANDLE (WINAPI * PFNICMPCREATEFILE)(
  55. VOID
  56. );
  57. typedef BOOL (WINAPI * PFNICMPCLOSEHANDLE)(
  58. HANDLE IcmpHandle
  59. );
  60. typedef BOOL (WINAPI * PFNICMPSENDECHO)(
  61. HANDLE IcmpHandle,
  62. IPAddr DestinationAddress,
  63. LPVOID RequestData,
  64. WORD RequestSize,
  65. PIP_OPTION_INFORMATION RequestOptions,
  66. LPVOID ReplyBuffer,
  67. DWORD ReplySize,
  68. DWORD Timeout
  69. );
  70. typedef struct rspsocket_tag
  71. {
  72. HMODULE hWS2;
  73. HMODULE hICMP;
  74. HANDLE IcmpHandle;
  75. PFNWSASTARTUP pFnWSAStartup;
  76. PFNWSACLEANUP pFnWSACleanup;
  77. PFNGETHOSTBYNAME pFngethostbyname;
  78. PFNICMPCREATEFILE pFnIcmpCreateFile;
  79. PFNICMPCLOSEHANDLE pFnIcmpCloseHandle;
  80. PFNICMPSENDECHO pFnIcmpSendEcho;
  81. } RSPSOCKET, * PRSPSOCKET;
  82. HRESULT SockStartup (
  83. RSPSOCKET * pSocket
  84. );
  85. HRESULT SockIsServerResponding(
  86. RSPSOCKET * pSocket,
  87. char * szServer
  88. );
  89. HRESULT SockShutdown (
  90. RSPSOCKET * pSocket
  91. );
  92. #ifdef __cplusplus
  93. }
  94. #endif
  95. #endif