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.

74 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1998, Microsoft Corporation
  3. Module Name:
  4. nathlpp.h
  5. Abstract:
  6. This module contains declarations common to the user-mode components
  7. of home-networking.
  8. Author:
  9. Abolade Gbadegesin (aboladeg) 5-Mar-1998
  10. Revision History:
  11. --*/
  12. #ifndef _NATHLP_NATHLPP_H_
  13. #define _NATHLP_NATHLPP_H_
  14. //
  15. // Object synchronization macros
  16. //
  17. #define ACQUIRE_LOCK(x) EnterCriticalSection(&(x)->Lock)
  18. #define RELEASE_LOCK(x) LeaveCriticalSection(&(x)->Lock)
  19. #define REFERENCE_OBJECT(x,deleted) \
  20. (deleted(x) \
  21. ? FALSE \
  22. : (InterlockedIncrement( \
  23. reinterpret_cast<LPLONG>(&(x)->ReferenceCount) \
  24. ), TRUE))
  25. #define DEREFERENCE_OBJECT(x,cleanup) \
  26. (InterlockedDecrement(reinterpret_cast<LPLONG>(&(x)->ReferenceCount)) \
  27. ? TRUE \
  28. : (cleanup(x), FALSE))
  29. //
  30. // Memory management macros
  31. //
  32. #define NH_ALLOCATE(s) HeapAlloc(GetProcessHeap(), 0, (s))
  33. #define NH_FREE(p) HeapFree(GetProcessHeap(), 0, (p))
  34. //
  35. // Protocol-related constants
  36. //
  37. #define DHCP_PORT_SERVER 0x4300
  38. #define DHCP_PORT_CLIENT 0x4400
  39. #define DNS_PORT_SERVER 0x3500
  40. #define WINS_PORT_SERVER 0x8900
  41. #define FTP_PORT_DATA 0x1400
  42. #define FTP_PORT_CONTROL 0x1500
  43. #define ALG_PORT_DATA 0x1600
  44. #define ALG_PORT_CONTROL 0x1700
  45. //
  46. // DNS suffix string
  47. //
  48. #define DNS_HOMENET_SUFFIX L"mshome.net" // default string
  49. #endif // _NATHLP_NATHLPP_H_