/**********************************************************************/ /** Microsoft Windows/NT **/ /** Copyright(c) Microsoft Corp., 1997 **/ /**********************************************************************/ /* ipxstrm.cpp FILE HISTORY: */ #include "stdafx.h" #include "ipxstrm.h" #include "xstream.h" /*!-------------------------------------------------------------------------- IPXAdminConfigStream::IPXAdminConfigStream - Author: KennT ---------------------------------------------------------------------------*/ IPXAdminConfigStream::IPXAdminConfigStream() { m_nVersionAdmin = 0x00020000; m_nVersion = 0x00020000; } /*!-------------------------------------------------------------------------- IPXAdminConfigStream::InitNew - Author: KennT ---------------------------------------------------------------------------*/ HRESULT IPXAdminConfigStream::InitNew() { // Setup the appropriate defaults // m_nVersionAdmin = 0x00020000; // m_nVersion = 0x00020000; // m_stName.Empty(); ConfigStream::InitNew(); return hrOK; } /*!-------------------------------------------------------------------------- IPXAdminConfigStream::SaveTo - Author: KennT ---------------------------------------------------------------------------*/ HRESULT IPXAdminConfigStream::SaveTo(IStream *pstm) { return XferVersion0(pstm, XferStream::MODE_WRITE, NULL); } /*!-------------------------------------------------------------------------- IPXAdminConfigStream::SaveAs - Author: KennT ---------------------------------------------------------------------------*/ HRESULT IPXAdminConfigStream::SaveAs(UINT nVersion, IStream *pstm) { return XferVersion0(pstm, XferStream::MODE_WRITE, NULL); } /*!-------------------------------------------------------------------------- IPXAdminConfigStream::LoadFrom - Author: KennT ---------------------------------------------------------------------------*/ HRESULT IPXAdminConfigStream::LoadFrom(IStream *pstm) { return XferVersion0(pstm, XferStream::MODE_READ, NULL); } /*!-------------------------------------------------------------------------- IPXAdminConfigStream::GetSize - Author: KennT ---------------------------------------------------------------------------*/ HRESULT IPXAdminConfigStream::GetSize(ULONG *pcbSize) { return XferVersion0(NULL, XferStream::MODE_SIZE, NULL); } /*!-------------------------------------------------------------------------- IPXAdminConfigStream::GetVersionInfo - Author: KennT ---------------------------------------------------------------------------*/ HRESULT IPXAdminConfigStream::GetVersionInfo(DWORD *pdwVersion, DWORD *pdwAdminVersion) { if (pdwVersion) *pdwVersion = m_nVersion; if (pdwAdminVersion) *pdwAdminVersion = m_nVersionAdmin; return hrOK; } /*!-------------------------------------------------------------------------- IPXAdminConfigStream::XferVersion0 - Author: KennT ---------------------------------------------------------------------------*/ struct _ViewInfoEntry { ULONG m_ulId; ULONG m_idSort; ULONG m_idAscending; ULONG m_idColumns; ULONG m_idPos; }; static const _ViewInfoEntry s_rgIPXAdminViewInfo[] = { { IPXSTRM_STATS_IPX, IPXSTRM_TAG_STATS_IPX_SORT, IPXSTRM_TAG_STATS_IPX_ASCENDING, IPXSTRM_TAG_STATS_IPX_COLUMNS, IPXSTRM_TAG_STATS_IPX_POSITION }, { IPXSTRM_STATS_ROUTING, IPXSTRM_TAG_STATS_IPXROUTING_SORT, IPXSTRM_TAG_STATS_IPXROUTING_ASCENDING, IPXSTRM_TAG_STATS_IPXROUTING_COLUMNS, IPXSTRM_TAG_STATS_IPXROUTING_POSITION }, { IPXSTRM_STATS_SERVICE, IPXSTRM_TAG_STATS_IPXSERVICE_SORT, IPXSTRM_TAG_STATS_IPXSERVICE_ASCENDING, IPXSTRM_TAG_STATS_IPXSERVICE_COLUMNS, IPXSTRM_TAG_STATS_IPXSERVICE_POSITION }, }; HRESULT IPXAdminConfigStream::XferVersion0(IStream *pstm, XferStream::Mode mode, ULONG *pcbSize) { XferStream xstm(pstm, mode); HRESULT hr = hrOK; int i; CORg( xstm.XferDWORD( IPXSTRM_TAG_VERSION, &m_nVersion ) ); CORg( xstm.XferDWORD( IPXSTRM_TAG_VERSIONADMIN, &m_nVersionAdmin ) ); for ( i=0; i