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.

93 lines
2.9 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 2000 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: DPLConset.h
  6. * Content: DirectPlay Lobby Connection Settings Utility Functions
  7. *@@BEGIN_MSINTERNAL
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 06/13/00 rmt Created
  12. * 02/06/2001 rodtoll WINBUG #293871: DPLOBBY8: [IA64] Lobby launching a 64-bit
  13. * app from 64-bit lobby launcher crashes with unaligned memory error.
  14. *@@END_MSINTERNAL
  15. *
  16. ***************************************************************************/
  17. #ifndef __DPLCONSET_H__
  18. #define __DPLCONSET_H__
  19. typedef UNALIGNED struct _DPL_INTERNAL_CONNECTION_SETTINGS DPL_INTERNAL_CONNECTION_SETTINGS;
  20. #define DPLSIGNATURE_LOBBYCONSET 'BSCL'
  21. #define DPLSIGNATURE_LOBBYCONSET_FREE 'BSC_'
  22. // CConnectionSettings
  23. //
  24. // This class is responsible for managing connection settings data.
  25. //
  26. class CConnectionSettings
  27. {
  28. public:
  29. CConnectionSettings( );
  30. ~CConnectionSettings();
  31. // Initialize (DPL_CONNECTION_SETTINGS version)
  32. //
  33. // This function tells this class to take the specified connection settings and
  34. // work with it.
  35. //
  36. HRESULT Initialize( DPL_CONNECTION_SETTINGS * pdplSettings );
  37. // Initialize (Wire Version)
  38. //
  39. // THis function initializes this object to contain a connection settings structure
  40. // that mirrors the values of the wire message.
  41. HRESULT Initialize( UNALIGNED DPL_INTERNAL_CONNECTION_SETTINGS *pdplSettingsMsg, UNALIGNED BYTE * pbBufferStart );
  42. // InitializeAndCopy
  43. //
  44. // This function initializes this class to contain a copy of the specified
  45. // connection settings structure.
  46. HRESULT InitializeAndCopy( const DPL_CONNECTION_SETTINGS * const pdplSettings );
  47. // SetEqual
  48. //
  49. // This function provides a deep copy of the specified class into this object
  50. HRESULT SetEqual( CConnectionSettings * pdplSettings );
  51. // CopyToBuffer
  52. //
  53. // This function copies the contents of the connection settings to the specified
  54. // buffer (if it fits).
  55. //
  56. HRESULT CopyToBuffer( BYTE *pbBuffer, DWORD *pdwBufferSize );
  57. // BuildWireStruct
  58. //
  59. // This function fills the packed buffer with the wire representation of the
  60. // connection settings structure.
  61. HRESULT BuildWireStruct( CPackedBuffer * pPackedBuffer );
  62. PDPL_CONNECTION_SETTINGS GetConnectionSettings() { return m_pdplConnectionSettings; };
  63. protected:
  64. void Lock() { DNEnterCriticalSection( &m_csLock ); };
  65. void UnLock() { DNLeaveCriticalSection( &m_csLock ); };
  66. static void FreeConnectionSettings( DPL_CONNECTION_SETTINGS *pConnectionSettings );
  67. DWORD m_dwSignature;
  68. #ifndef DPNBUILD_ONLYONETHREAD
  69. DNCRITICAL_SECTION m_csLock;
  70. #endif // !DPNBUILD_ONLYONETHREAD
  71. BOOL m_fManaged;
  72. DPL_CONNECTION_SETTINGS *m_pdplConnectionSettings;
  73. BOOL m_fCritSecInited;
  74. };
  75. #endif // __DPLCONSET_H__