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.

124 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. q931obj.h
  5. Abstract:
  6. Author:
  7. Nikhil Bobde (NikhilB)
  8. Revision History:
  9. --*/
  10. #ifndef _Q931_OBJ_H_
  11. #define _Q931_OBJ_H_
  12. #define Q931_RECV_BUFFER_LENGTH 0x2000
  13. typedef struct _RECVBUF
  14. {
  15. WSABUF WSABuf;
  16. union {
  17. OVERLAPPED Overlapped;
  18. LIST_ENTRY ListEntry;
  19. };
  20. DWORD dwBytesCopied;
  21. DWORD dwPDULen;
  22. char arBuf[Q931_RECV_BUFFER_LENGTH];
  23. } RECVBUF;
  24. void FreeAddressAliases( PSetup_UUIE_destinationAddress pAddr );
  25. void CopyTransportAddress( TransportAddress& transportAddress,
  26. PH323_ADDR pCalleeAddr );
  27. void AddressReverseAndCopy( DWORD *dwAddr, BYTE* addrValue );
  28. Setup_UUIE_sourceAddress * SetMsgAddressAlias(
  29. PH323_ALIASNAMES pCallerAliasNames );
  30. void CopyVendorInfo( VendorIdentifier* vendor );
  31. HRESULT Q931AcceptStart (void);
  32. void Q931AcceptStop (void);
  33. BOOL Q931AllocRecvBuffer (
  34. OUT RECVBUF ** ReturnRecvBuffer);
  35. void Q931FreeRecvBuffer (
  36. IN RECVBUF * RecvBuffer);
  37. #define Q931_CONN_QUEUE_LEN 64
  38. #define ACCEPT_BUFFER_LENGTH ((sizeof(SOCKADDR_IN) + 0x10) * 2)
  39. class Q931_LISTENER;
  40. struct Q931_ACCEPT_OVERLAPPED
  41. {
  42. OVERLAPPED Overlapped;
  43. LIST_ENTRY ListEntry;
  44. Q931_LISTENER * ParentObject;
  45. SOCKET Socket;
  46. DWORD BytesTransferred;
  47. BYTE DataBuffer [ACCEPT_BUFFER_LENGTH];
  48. };
  49. class Q931_LISTENER
  50. {
  51. private:
  52. CRITICAL_SECTION m_CriticalSection;
  53. SOCKET m_ListenSocket;
  54. LIST_ENTRY m_AcceptPendingList; // contains ACCEPT_OVERLAPPED.ListEntry
  55. HANDLE m_StopNotifyEvent;
  56. SOCKADDR_IN m_SocketAddress; // address (actually, only port) listening on
  57. private:
  58. static void NTAPI IoCompletionCallback (
  59. IN DWORD dwStatus,
  60. IN DWORD BytesTransferred,
  61. IN OVERLAPPED * Overlapped);
  62. void Lock (void) { EnterCriticalSection (&m_CriticalSection); }
  63. void Unlock (void) { LeaveCriticalSection (&m_CriticalSection); }
  64. HRESULT StartLocked (void);
  65. HRESULT AllocIssueAccept (void);
  66. HRESULT IssueAccept (
  67. IN Q931_ACCEPT_OVERLAPPED * AcceptOverlapped);
  68. void CompleteAccept (
  69. IN DWORD dwStatus,
  70. IN Q931_ACCEPT_OVERLAPPED * AcceptOverlapped);
  71. public:
  72. Q931_LISTENER (void);
  73. ~Q931_LISTENER (void);
  74. HRESULT Start (void);
  75. void Stop (void);
  76. void WaitIo (void);
  77. WORD GetListenPort (void);
  78. void HandleRegistryChange();
  79. };
  80. #endif //_Q931_OBJ_H_