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.

152 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 1998 - 2000 Microsoft Corporation
  3. Module Name:
  4. main.h
  5. Abstract:
  6. Contains:
  7. 1. Prototypes for routines used in asynchrounous I/O
  8. 2. Definitions of constants and macros used by the above routines
  9. 3. Definitions of macros and inline routines for memory management
  10. Environment:
  11. User Mode - Win32
  12. History:
  13. 1. 31-Jul-1998 -- File creation Ajay Chitturi (ajaych)
  14. 2. 15-Jul-1999 -- Arlie Davis (arlied)
  15. 3. 14-Feb-2000 -- Added support for multiple Ilya Kleyman (ilyak)
  16. private interfaces
  17. --*/
  18. #ifndef __h323ics_main_h
  19. #define __h323ics_main_h
  20. ///////////////////////////////////////////////////////////////////////////////
  21. // //
  22. // Constants and macros //
  23. // //
  24. ///////////////////////////////////////////////////////////////////////////////
  25. #define DEFAULT_TRACE_FLAGS LOG_TRCE
  26. #define MAX_LISTEN_BACKLOG 5
  27. #define LOCAL_INTERFACE_INDEX ((ULONG)-2)
  28. ///////////////////////////////////////////////////////////////////////////////
  29. // //
  30. // Global variables //
  31. // //
  32. ///////////////////////////////////////////////////////////////////////////////
  33. extern HANDLE NatHandle;
  34. extern DWORD EnableLocalH323Routing;
  35. ///////////////////////////////////////////////////////////////////////////////
  36. // //
  37. // Prototypes for routines used in asynchrounous I/O //
  38. // //
  39. ///////////////////////////////////////////////////////////////////////////////
  40. HRESULT
  41. EventMgrIssueAccept (
  42. IN DWORD BindIPAddress, // in HOST order
  43. IN OVERLAPPED_PROCESSOR & OverlappedProcessor,
  44. OUT WORD & BindPort, // in HOST order
  45. OUT SOCKET & ListenSocket
  46. );
  47. HRESULT
  48. EventMgrIssueSend(
  49. IN SOCKET Socket,
  50. IN OVERLAPPED_PROCESSOR & OverlappedProcessor,
  51. IN BYTE *Buffer,
  52. IN DWORD BufferLength
  53. );
  54. HRESULT
  55. EventMgrIssueRecv(
  56. IN SOCKET Socket,
  57. IN OVERLAPPED_PROCESSOR & OverlappedProcessor
  58. );
  59. HRESULT
  60. EventMgrBindIoHandle(
  61. IN SOCKET Socket
  62. );
  63. ///////////////////////////////////////////////////////////////////////////////
  64. // //
  65. // Memory management support //
  66. // //
  67. ///////////////////////////////////////////////////////////////////////////////
  68. __inline
  69. void *EM_MALLOC (
  70. IN size_t Size
  71. )
  72. /*++
  73. Routine Description:
  74. Private memory allocator.
  75. Arguments:
  76. Size - number of bytes to allocate
  77. Return Values:
  78. - Pointer to allocated memory, if successful.
  79. - NULL otherwise.
  80. Notes:
  81. --*/
  82. {
  83. return (HeapAlloc (GetProcessHeap (),
  84. 0, /* no flags */
  85. (Size)));
  86. } // EM_MALLOC
  87. __inline
  88. void
  89. EM_FREE(
  90. IN void *Memory
  91. )
  92. /*++
  93. Routine Description:
  94. Private memory deallocator
  95. Arguments:
  96. Memory -- pointer to allocated memory
  97. Return Values:
  98. None
  99. Notes:
  100. The memory should have previously been
  101. allocated via EM_MALLOC
  102. --*/
  103. {
  104. HeapFree (GetProcessHeap (),
  105. 0, /* no flags */
  106. (Memory));
  107. } // EM_FREE
  108. #endif // __h323ics_main_h