/**********************************************************************/ /** Microsoft Windows/NT **/ /** Copyright(c) Microsoft Corporation, 1997 - 1997 **/ /**********************************************************************/ /* ripstrm.cpp FILE HISTORY: */ #include "stdafx.h" #include "ripstrm.h" #include "xstream.h" /*!-------------------------------------------------------------------------- RipConfigStream::RipConfigStream - Author: KennT ---------------------------------------------------------------------------*/ RipConfigStream::RipConfigStream() { m_nVersionAdmin = 0x00020000; m_nVersion = 0x00020000; } /*!-------------------------------------------------------------------------- RipConfigStream::InitNew - Author: KennT ---------------------------------------------------------------------------*/ HRESULT RipConfigStream::InitNew() { // Setup the appropriate defaults // m_nVersionAdmin = 0x00020000; // m_nVersion = 0x00020000; // m_stName.Empty(); return hrOK; } /*!-------------------------------------------------------------------------- RipConfigStream::SaveTo - Author: KennT ---------------------------------------------------------------------------*/ HRESULT RipConfigStream::SaveTo(IStream *pstm) { return XferVersion0(pstm, XferStream::MODE_WRITE, NULL); } /*!-------------------------------------------------------------------------- RipConfigStream::SaveAs - Author: KennT ---------------------------------------------------------------------------*/ HRESULT RipConfigStream::SaveAs(UINT nVersion, IStream *pstm) { return XferVersion0(pstm, XferStream::MODE_WRITE, NULL); } /*!-------------------------------------------------------------------------- RipConfigStream::LoadFrom - Author: KennT ---------------------------------------------------------------------------*/ HRESULT RipConfigStream::LoadFrom(IStream *pstm) { return XferVersion0(pstm, XferStream::MODE_READ, NULL); } /*!-------------------------------------------------------------------------- RipConfigStream::GetSize - Author: KennT ---------------------------------------------------------------------------*/ HRESULT RipConfigStream::GetSize(ULONG *pcbSize) { return XferVersion0(NULL, XferStream::MODE_SIZE, NULL); } /*!-------------------------------------------------------------------------- RipConfigStream::GetVersionInfo - Author: KennT ---------------------------------------------------------------------------*/ HRESULT RipConfigStream::GetVersionInfo(DWORD *pdwVersion, DWORD *pdwAdminVersion) { if (pdwVersion) *pdwVersion = m_nVersion; if (pdwAdminVersion) *pdwAdminVersion = m_nVersionAdmin; return hrOK; } /*!-------------------------------------------------------------------------- RipConfigStream::XferVersion0 - Author: KennT ---------------------------------------------------------------------------*/ struct _ViewInfoEntry { ULONG m_ulId; ULONG m_idSort; ULONG m_idAscending; ULONG m_idColumns; ULONG m_idPos; }; static const _ViewInfoEntry s_rgRIPAdminViewInfo[] = { { RIPSTRM_STATS_RIPPARAMS, RIPSTRM_TAG_STATS_RIPPARAMS_SORT, RIPSTRM_TAG_STATS_RIPPARAMS_ASCENDING, RIPSTRM_TAG_STATS_RIPPARAMS_COLUMNS, RIPSTRM_TAG_STATS_RIPPARAMS_POSITION }, }; HRESULT RipConfigStream::XferVersion0(IStream *pstm, XferStream::Mode mode, ULONG *pcbSize) { XferStream xstm(pstm, mode); HRESULT hr = hrOK; int i; CORg( xstm.XferDWORD( RIPSTRM_TAG_VERSION, &m_nVersion ) ); CORg( xstm.XferDWORD( RIPSTRM_TAG_VERSIONADMIN, &m_nVersionAdmin ) ); for ( i=0; i