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.

77 lines
2.3 KiB

  1. #include <nt.h>
  2. #include <ntrtl.h>
  3. #include <nturtl.h>
  4. #include <windows.h>
  5. #include <ndisguid.h>
  6. #include <wmium.h>
  7. #include <winsvc.h>
  8. #include <rtutils.h>
  9. #include <tchar.h>
  10. #include <winsock2.h>
  11. #include <ws2tcpip.h>
  12. #include <stdio.h>
  13. #include <iphlpapi.h>
  14. #include <iptypes.h>
  15. #pragma warning(disable:4057) // 'volatile LONG *' differs in indirection to
  16. // slightly different base types from 'ULONG *'
  17. #pragma warning(disable:4100) // unreferenced formal parameter
  18. #pragma warning(disable:4152) // function/data pointer conversion
  19. #pragma warning(disable:4200) // zero-sized array in struct/union
  20. #pragma warning(disable:4201) // nameless struct/union
  21. #pragma warning(disable:4214) // bit field types other than int
  22. #include <ip6.h>
  23. #include <icmp6.h>
  24. #include <ntddip6.h>
  25. #include <ws2ip6.h>
  26. #include <rasuip.h>
  27. #include <mswsock.h>
  28. #include "trace.h"
  29. #include "6to4.h"
  30. #include "isatap.h"
  31. #include "teredo.h"
  32. #define isnot !=
  33. #define is ==
  34. //
  35. // instead of using goto:end to go to the end of the block, use the following
  36. //
  37. #define BEGIN_BREAKOUT_BLOCK1 do
  38. #define GOTO_END_BLOCK1 goto END_BREAKOUT_BLOCK_1
  39. #define END_BREAKOUT_BLOCK1 while(FALSE); END_BREAKOUT_BLOCK_1:
  40. #define BEGIN_BREAKOUT_BLOCK2 do
  41. #define GOTO_END_BLOCK2 goto END_BREAKOUT_BLOCK_2
  42. #define END_BREAKOUT_BLOCK2 while(FALSE); END_BREAKOUT_BLOCK_2:
  43. extern DWORD g_TraceId;
  44. extern HANDLE g_LogHandle;
  45. extern DWORD g_dwLoggingLevel;
  46. extern HANDLE g_Heap;
  47. extern HANDLE g_Lock;
  48. //
  49. // WaitForSingleObject should always succeed, since we should never
  50. // time out, abandon the mutex, or pass an invalid handle.
  51. //
  52. #define ENTER_API() \
  53. if (WaitForSingleObject(g_Lock, INFINITE) != WAIT_OBJECT_0) \
  54. ASSERT(FALSE)
  55. #define LEAVE_API() \
  56. ReleaseMutex(g_Lock)
  57. #define MALLOC(x) HeapAlloc(g_Heap, 0, x)
  58. #define FREE(x) HeapFree(g_Heap, 0, x)
  59. #define REALLOC(x, y) HeapReAlloc(g_Heap, 0, x, y)
  60. #define PROFILE(x) printf("%s\n", x)
  61. #define PRINT_IPADDR(x) \
  62. ((x)&0x000000ff),(((x)&0x0000ff00)>>8),(((x)&0x00ff0000)>>16),(((x)&0xff000000)>>24)
  63. VOID WINAPI
  64. ServiceMain(
  65. IN DWORD argc,
  66. IN LPWSTR *argv);