📄 cliauth.cpp
字号:
/* ***** BEGIN LICENSE BLOCK ***** * Source last modified: $Id: cliauth.cpp,v 1.1.36.3 2004/07/09 01:47:11 hubbe Exp $ * * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved. * * The contents of this file, and the files included with this file, * are subject to the current version of the RealNetworks Public * Source License (the "RPSL") available at * http://www.helixcommunity.org/content/rpsl unless you have licensed * the file under the current version of the RealNetworks Community * Source License (the "RCSL") available at * http://www.helixcommunity.org/content/rcsl, in which case the RCSL * will apply. You may also obtain the license terms directly from * RealNetworks. You may not use this file except in compliance with * the RPSL or, if you have a valid RCSL with RealNetworks applicable * to this file, the RCSL. Please see the applicable RPSL or RCSL for * the rights, obligations and limitations governing use of the * contents of the file. * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 or later (the * "GPL") in which case the provisions of the GPL are applicable * instead of those above. If you wish to allow use of your version of * this file only under the terms of the GPL, and not to allow others * to use your version of this file under the terms of either the RPSL * or RCSL, indicate your decision by deleting the provisions above * and replace them with the notice and other provisions required by * the GPL. If you do not delete the provisions above, a recipient may * use your version of this file under the terms of any one of the * RPSL, the RCSL or the GPL. * * This file is part of the Helix DNA Technology. RealNetworks is the * developer of the Original Code and owns the copyrights in the * portions it created. * * This file, and the files included with this file, is distributed * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET * ENJOYMENT OR NON-INFRINGEMENT. * * Technology Compatibility Kit Test Suite(s) Location: * http://www.helixcommunity.org/content/tck * * Contributor(s): * * ***** END LICENSE BLOCK ***** */#include "hxtypes.h"#include "hxcom.h"#include "hxauth.h"#include "hxplugn.h"#include "hxplgns.h"#include "ihxpckts.h"#include "hxfiles.h"#include "hxauthn.h"#include "hxmon.h"#include "chxpckts.h"#include "cliauth.h"#include "hxplgsp.h"#include "hxplnsp.h"#include "crdcache.h"#include "hxheap.h"#ifdef _DEBUG#undef HX_THIS_FILEstatic char HX_THIS_FILE[] = __FILE__;#endif_CListOfWrapped_IUnknown_Node::_CListOfWrapped_IUnknown_Node() : m_plocPrev(NULL) , m_plocNext(NULL){}_CListOfWrapped_IUnknown_Node::~_CListOfWrapped_IUnknown_Node(){ Remove();}void_CListOfWrapped_IUnknown_Node::Remove(){ if(m_plocPrev) { m_plocPrev->next(m_plocNext); } if(m_plocNext) { m_plocNext->prev(m_plocPrev); }}void_CListOfWrapped_IUnknown_Node::Insert(_CListOfWrapped_IUnknown_Node& rlocnNew){ rlocnNew.next(this); rlocnNew.prev(m_plocPrev); if(m_plocPrev) { m_plocPrev->next(&rlocnNew); } m_plocPrev = &rlocnNew;}Wrapped_IUnknown&_CListOfWrapped_IUnknown_Node::value(){ return m_clsValue;}const Wrapped_IUnknown&_CListOfWrapped_IUnknown_Node::value() const{ return m_clsValue;}void_CListOfWrapped_IUnknown_Node::value(const Wrapped_IUnknown& rclsNewValue){ m_clsValue = rclsNewValue;}_CListOfWrapped_IUnknown_Node&_CListOfWrapped_IUnknown_Node::operator=(const Wrapped_IUnknown& rclsNewValue){ m_clsValue = rclsNewValue; return *this;}_CListOfWrapped_IUnknown_Node*_CListOfWrapped_IUnknown_Node::next() const{ return m_plocNext;}void_CListOfWrapped_IUnknown_Node::next(_CListOfWrapped_IUnknown_Node* plocnNew){ m_plocNext = plocnNew;}_CListOfWrapped_IUnknown_Node*_CListOfWrapped_IUnknown_Node::prev() const{ return m_plocPrev;}void_CListOfWrapped_IUnknown_Node::prev(_CListOfWrapped_IUnknown_Node* plocnNew){ m_plocPrev = plocnNew;}_CListOfWrapped_IUnknown_::_CListOfWrapped_IUnknown_(){ m_locnREnd.next(&m_locnEnd); m_locnEnd.prev(&m_locnREnd);}_CListOfWrapped_IUnknown_::_CListOfWrapped_IUnknown_(const _CListOfWrapped_IUnknown_& rlocOther){ m_locnREnd.next(&m_locnEnd); m_locnEnd.prev(&m_locnREnd); _copy(rlocOther);}_CListOfWrapped_IUnknown_::~_CListOfWrapped_IUnknown_(){ empty();}_CListOfWrapped_IUnknown_&_CListOfWrapped_IUnknown_::operator=(const _CListOfWrapped_IUnknown_& rlocOther){ empty(); _copy(rlocOther); return *this;}void_CListOfWrapped_IUnknown_::_copy(const _CListOfWrapped_IUnknown_& rlocOther){ iterator itOther; for ( itOther = rlocOther.begin(); itOther != rlocOther.end(); ++itOther ) { insert(end(), *itOther); }}_CListOfWrapped_IUnknown_::iterator_CListOfWrapped_IUnknown_::begin(){ return iterator(*(m_locnREnd.next()));}const _CListOfWrapped_IUnknown_::iterator_CListOfWrapped_IUnknown_::begin() const{ return iterator(*(m_locnREnd.next()));}_CListOfWrapped_IUnknown_::iterator_CListOfWrapped_IUnknown_::end(){ return iterator(m_locnEnd);}const _CListOfWrapped_IUnknown_::iterator_CListOfWrapped_IUnknown_::end() const{ return iterator(m_locnEnd);}_CListOfWrapped_IUnknown_::reverse_iterator_CListOfWrapped_IUnknown_::rbegin(){ _CListOfWrapped_IUnknown_::reverse_iterator temp(*(m_locnEnd.prev())); return temp;}const _CListOfWrapped_IUnknown_::reverse_iterator _CListOfWrapped_IUnknown_::rbegin() const{ _CListOfWrapped_IUnknown_::reverse_iterator temp(*(m_locnEnd.prev())); return temp;}_CListOfWrapped_IUnknown_::reverse_iterator_CListOfWrapped_IUnknown_::rend(){ _CListOfWrapped_IUnknown_::reverse_iterator temp(m_locnREnd); return temp;}const _CListOfWrapped_IUnknown_::reverse_iterator_CListOfWrapped_IUnknown_::rend() const{ _CListOfWrapped_IUnknown_::reverse_iterator temp(*((const _CListOfWrapped_IUnknown_Node *)&m_locnREnd)); return temp;}_CListOfWrapped_IUnknown_::iterator_CListOfWrapped_IUnknown_::insert(iterator itBefore, const Wrapped_IUnknown& rclsNew){ _CListOfWrapped_IUnknown_Node* plocnNew = new _CListOfWrapped_IUnknown_Node; HX_ASSERT(plocnNew); *plocnNew = rclsNew; itBefore.m_plocCurrent->Insert(*plocnNew); return iterator(*plocnNew);}void_CListOfWrapped_IUnknown_::insert( iterator itBefore, const iterator itFirst, const iterator itLast){ iterator itOther; _CListOfWrapped_IUnknown_Node* plocnNew; for (itOther = itFirst; itOther != itLast; ++itOther) { plocnNew = new _CListOfWrapped_IUnknown_Node; HX_ASSERT(plocnNew); *plocnNew = *itOther; itBefore.m_plocCurrent->Insert(*plocnNew); }}void_CListOfWrapped_IUnknown_::remove(iterator itThis){ if ( itThis.m_plocCurrent == &m_locnEnd || itThis.m_plocCurrent == &m_locnREnd ) { return; } _CListOfWrapped_IUnknown_Node* plocnOld; plocnOld = itThis.m_plocCurrent; ++itThis; plocnOld->Remove(); delete plocnOld;}void_CListOfWrapped_IUnknown_::remove(iterator itFirst, iterator itLast){ if ( itFirst.m_plocCurrent == &m_locnEnd || itFirst.m_plocCurrent == &m_locnREnd ) { return; } iterator itOther; _CListOfWrapped_IUnknown_Node* plocnOld; for (itOther = itFirst; itOther != itLast;) { plocnOld = itOther.m_plocCurrent; ++itOther; plocnOld->Remove(); delete plocnOld; }}void_CListOfWrapped_IUnknown_::empty(){ remove(begin(), end());}_CListIteratorWrapped_IUnknown_::_CListIteratorWrapped_IUnknown_() : m_plocCurrent(NULL){}_CListIteratorWrapped_IUnknown_::_CListIteratorWrapped_IUnknown_( const _CListOfWrapped_IUnknown_Node& rlocnNewLocation) : m_plocCurrent((_CListOfWrapped_IUnknown_Node*)&rlocnNewLocation){}_CListIteratorWrapped_IUnknown_::_CListIteratorWrapped_IUnknown_( const _CListIteratorWrapped_IUnknown_& rliocOther) : m_plocCurrent(rliocOther.m_plocCurrent){}_CListIteratorWrapped_IUnknown_::~_CListIteratorWrapped_IUnknown_(){}_CListIteratorWrapped_IUnknown_&_CListIteratorWrapped_IUnknown_::operator=( const _CListIteratorWrapped_IUnknown_& rliocOther){ m_plocCurrent = rliocOther.m_plocCurrent; return *this;}Wrapped_IUnknown&_CListIteratorWrapped_IUnknown_::operator*(){ HX_ASSERT(m_plocCurrent); return m_plocCurrent->value();}_CListIteratorWrapped_IUnknown_&_CListIteratorWrapped_IUnknown_::operator=(const Wrapped_IUnknown& rclsNewValue){ if(!m_plocCurrent) return *this; m_plocCurrent->value(rclsNewValue); return *this;}_CListIteratorWrapped_IUnknown_&_CListIteratorWrapped_IUnknown_::operator++(){ if(!m_plocCurrent) return *this; m_plocCurrent = m_plocCurrent->next(); return *this;}const _CListIteratorWrapped_IUnknown__CListIteratorWrapped_IUnknown_::operator++(int){ _CListIteratorWrapped_IUnknown_ liocRet(*this); ++(*this); return liocRet;}_CListIteratorWrapped_IUnknown_&_CListIteratorWrapped_IUnknown_::operator--(){ if(!m_plocCurrent) return *this; m_plocCurrent = m_plocCurrent->prev(); return *this;}const _CListIteratorWrapped_IUnknown__CListIteratorWrapped_IUnknown_::operator--(int){ _CListIteratorWrapped_IUnknown_ liocRet(*this); --(*this); return liocRet;}BOOL operator==( const _CListIteratorWrapped_IUnknown_& rliocLeft, const _CListIteratorWrapped_IUnknown_& rliocRight){ return (rliocLeft.m_plocCurrent == rliocRight.m_plocCurrent);}BOOL operator!=( const _CListIteratorWrapped_IUnknown_& rliocLeft, const _CListIteratorWrapped_IUnknown_& rliocRight){ return (rliocLeft.m_plocCurrent != rliocRight.m_plocCurrent);}_CListReverseIteratorWrapped_IUnknown_::_CListReverseIteratorWrapped_IUnknown_() : m_plocCurrent(NULL){}_CListReverseIteratorWrapped_IUnknown_::_CListReverseIteratorWrapped_IUnknown_( const _CListOfWrapped_IUnknown_Node& rlocnNewLocation) : m_plocCurrent((_CListOfWrapped_IUnknown_Node*)&rlocnNewLocation){}_CListReverseIteratorWrapped_IUnknown_::_CListReverseIteratorWrapped_IUnknown_( const _CListReverseIteratorWrapped_IUnknown_& rlriocOther) : m_plocCurrent(rlriocOther.m_plocCurrent){}_CListReverseIteratorWrapped_IUnknown_::~_CListReverseIteratorWrapped_IUnknown_(){}_CListReverseIteratorWrapped_IUnknown_&_CListReverseIteratorWrapped_IUnknown_::operator=( const _CListReverseIteratorWrapped_IUnknown_& rlriocOther){ m_plocCurrent = rlriocOther.m_plocCurrent; return *this;}Wrapped_IUnknown&_CListReverseIteratorWrapped_IUnknown_::operator*(){ HX_ASSERT(m_plocCurrent); return m_plocCurrent->value();}_CListReverseIteratorWrapped_IUnknown_&_CListReverseIteratorWrapped_IUnknown_::operator=(const Wrapped_IUnknown& rclsNewValue){ if(!m_plocCurrent) return *this; m_plocCurrent->value(rclsNewValue); return *this;}_CListReverseIteratorWrapped_IUnknown_&_CListReverseIteratorWrapped_IUnknown_::operator++(){ if(!m_plocCurrent) return *this; m_plocCurrent = m_plocCurrent->prev(); return *this;}const _CListReverseIteratorWrapped_IUnknown__CListReverseIteratorWrapped_IUnknown_::operator++(int){ _CListReverseIteratorWrapped_IUnknown_ lriocRet(*this); ++(*this); return lriocRet;}_CListReverseIteratorWrapped_IUnknown_&_CListReverseIteratorWrapped_IUnknown_::operator--(){ if(!m_plocCurrent) return *this; m_plocCurrent = m_plocCurrent->next(); return *this;}const _CListReverseIteratorWrapped_IUnknown__CListReverseIteratorWrapped_IUnknown_::operator--(int){ _CListReverseIteratorWrapped_IUnknown_ lriocRet(*this); --(*this); return lriocRet;}BOOL operator==( const _CListReverseIteratorWrapped_IUnknown_& rlriocLeft, const _CListReverseIteratorWrapped_IUnknown_& rlriocRight){ return (rlriocLeft.m_plocCurrent == rlriocRight.m_plocCurrent);}BOOL operator!=( const _CListReverseIteratorWrapped_IUnknown_& rlriocLeft, const _CListReverseIteratorWrapped_IUnknown_& rlriocRight){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -