⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 svrauth.cpp

📁 linux下的一款播放器
💻 CPP
📖 第 1 页 / 共 3 页
字号:
    if(ptCurrent == PT_COMPOSITE)    {	sPluginIDPath = pcharPropertyPath;	sPluginIDPath += ".";	sPluginIDPath += pcharRealPropertyNameLoc;	if 	(	    FAILED	    (		spregRegistry->GetStrByName		(		    sPluginIDPath, 		    *ppIHXBufferPluginName		)	    )	)	{	    pcharPropertyName = strrchr(pcharPropertyPath, '.');	    if(!pcharPropertyName)	    {		pcharPropertyName = pcharPropertyPath;	    }	    else	    {		pcharPropertyName++;	    }	    CHXBuffer::FromCharArray	    (		pcharPropertyName, 		ppIHXBufferPluginName	    );	}	return spregRegistry->GetPropListById	(	    ulProperty_id, 	    *ppIHXValuesPluginProperties	);    }    return HXR_FAIL;}HX_RESULT CServerAuthenticator::_GetNextPlugin(    IHXValues* pIHXValuesPluginList,    IHXBuffer** ppIHXBufferPluginName,     IHXValues** ppIHXValuesPluginProperties){    if(!m_spIUnknownContext.IsValid())    {	return HXR_UNEXPECTED;    }    const char* pcharPropertyPath;    UINT32 ulProperty_id;    HX_RESULT HX_RESULTRes = HXR_OK;    while    (	SUCCEEDED	(	    HX_RESULTRes	)	&&	SUCCEEDED	(	    pIHXValuesPluginList->GetNextPropertyULONG32	    (		pcharPropertyPath, 		ulProperty_id	    )	)    )    {	HX_RESULTRes = _GetPluginDataFromID	(	    pcharPropertyPath,	    ulProperty_id,	    "PluginID",	    ppIHXBufferPluginName,	    ppIHXValuesPluginProperties	);	if(SUCCEEDED(HX_RESULTRes))	{	    return HX_RESULTRes;	}	HX_RELEASE(*ppIHXBufferPluginName);	HX_RELEASE(*ppIHXValuesPluginProperties);    }    return HXR_FAIL;}HX_RESULT CServerAuthenticator::_TryToLoadPlugins(){    if    (	m_spIUnknownContext.IsValid()	&& 	m_spIHXValuesConfig.IsValid()    )    {	DECLARE_SMART_POINTER(IHXValues)	spIHXValuesPluginList;	DECLARE_SMART_POINTER(IHXValues)	spIHXValuesPluginProperties;	DECLARE_SMART_POINTER(IHXBuffer)	spIHXBufferPluginID;	DECLARE_SMART_POINTER(IHXBuffer)	spIHXBufferRealm;	DECLARE_SMART_POINTER_UNKNOWN		spIUnknownPlugin;	if	(	    SUCCEEDED	    (		m_spIHXValuesConfig->GetPropertyCString		(		    "Realm",		    spIHXBufferRealm.ptr_reference()		)	    )	    &&	    SUCCEEDED	    (		_GetRealmSettings		(		    (char*)spIHXBufferRealm->GetBuffer(), 		    &spIHXValuesPluginList		)	    )	)	{	    HX_RESULT HX_RESULTRet = _GetFirstPlugin	    (		spIHXValuesPluginList, 		&spIHXBufferPluginID, 		&spIHXValuesPluginProperties	    );	    while(SUCCEEDED(HX_RESULTRet))	    {//		cout << spIHXBufferPluginID->GetBuffer() << endl;		spIUnknownPlugin.Release();		_CreatePlugin		(		    spIHXBufferPluginID, 		    spIHXValuesPluginProperties, 		    &spIUnknownPlugin		);		if(spIUnknownPlugin.IsValid())		{		    // Insert at end!! Order matters!!		    m_ListOfIUnknownPlugins.insert		    (			m_ListOfIUnknownPlugins.end(), 			spIUnknownPlugin		    );		}		spIHXValuesPluginProperties.Release();		spIHXBufferPluginID.Release();		HX_RESULTRet = _GetNextPlugin		(		    spIHXValuesPluginList, 		    &spIHXBufferPluginID, 		    &spIHXValuesPluginProperties		);	    }	}    }    return HXR_OK;}HX_RESULTCServerAuthenticator::_CreatePlugin(    IHXBuffer* pIHXBufferPluginID,    IHXValues* pIHXValuesPluginProperties,    IUnknown** ppIUnknownPlugin){    DECLARE_SMART_POINTER    (	IHXServerAuthConversation    )					spIHXServerAuthConversationPlugin;    DECLARE_SMART_POINTER    (	IHXObjectConfiguration    )					spIHXObjectConfigurationPlugin;    DECLARE_SMART_POINTER    (	IHXPluginEnumerator    )					sppePlugins;    DECLARE_SMART_POINTER(IHXValues)	spIHXValuesPluginOptions;    DECLARE_SMART_POINTER(IHXValues)	spIHXValuesPluginValues;    DECLARE_SMART_POINTER(IHXBuffer)	spIHXBufferPluginID;    DECLARE_SMART_POINTER    (	IHXPluginProperties    )					spIHXPluginPropertiesPlugin;    UINT32				ulIndex;    UINT32				ulNumPlugins;    HX_RESULT				HX_RESULTRet = HXR_FAIL;    sppePlugins = m_spIUnknownContext;    if(sppePlugins.IsValid())    {	ulNumPlugins = sppePlugins->GetNumOfPlugins();	// Load all auth plugins	for(ulIndex = 0; ulIndex < ulNumPlugins; ++ulIndex)	{	    HX_RELEASE(*ppIUnknownPlugin);	    sppePlugins->GetPlugin	    (		ulIndex, 		(*ppIUnknownPlugin)	    );	    // Check to see if this is a ServerAuthenticator plugin	    spIHXServerAuthConversationPlugin = (*ppIUnknownPlugin);	    if(spIHXServerAuthConversationPlugin.IsValid())	    {		// Check to see if it has IHXObjectConfiguration		spIHXObjectConfigurationPlugin = (*ppIUnknownPlugin);		// Check to see if it has IHXPluginProperties		spIHXPluginPropertiesPlugin = (*ppIUnknownPlugin);		if		(		    spIHXPluginPropertiesPlugin.IsValid() 		    && 		    spIHXObjectConfigurationPlugin.IsValid()		)		{		    // Initialize it		    spIHXObjectConfigurationPlugin->SetContext		    (			m_spIUnknownContext		    );		    // Get the options from the plugin		    spIHXValuesPluginOptions.Release();		    spIHXPluginPropertiesPlugin->GetProperties		    (			spIHXValuesPluginOptions.ptr_reference()		    );		    spIHXBufferPluginID.Release();		    spIHXValuesPluginOptions->GetPropertyCString		    (			"PluginID",			spIHXBufferPluginID.ptr_reference()		    );		    // If this is the desired plugin		    if		    (			spIHXBufferPluginID.IsValid()			&&			!strcasecmp			(			    (char*)spIHXBufferPluginID->GetBuffer(),			    (char*)pIHXBufferPluginID->GetBuffer()			)		    )		    {			_ValuesFromHXRegList			(			    pIHXValuesPluginProperties,			    &spIHXValuesPluginValues			);			spIHXObjectConfigurationPlugin->SetConfiguration			(			    spIHXValuesPluginValues			);			HX_RESULTRet = HXR_OK;			break;		    }		}	    }	}	if (FAILED(HX_RESULTRet))	{	    HX_RELEASE(*ppIUnknownPlugin);	}    }    return HX_RESULTRet;}HX_RESULTCServerAuthenticator::_ValuesFromHXRegList(    IHXValues* pIHXValuesPNRegList,    IHXValues** ppIHXValuesValues){    DECLARE_SMART_POINTER(IHXBuffer) spIHXBufferRealm;    DECLARE_SMART_POINTER(IHXRegistry)	    spregRegistry;    IHXBuffer* pBuffer;    const char* propSubName;    const char* propName;    UINT32 prop_id;    INT32 val;    HXPropType type;    HX_RESULT res;    spregRegistry = m_spIUnknownContext;    (*ppIHXValuesValues) = new CHXHeader();    (*ppIHXValuesValues)->AddRef();    res = pIHXValuesPNRegList->GetFirstPropertyULONG32(propName, prop_id);    while(res == HXR_OK)    {	type = spregRegistry->GetTypeById(prop_id);	propSubName = strrchr(propName, '.') + 1;	switch(type)	{	    case PT_INTEGER:	    {		if(HXR_OK == spregRegistry->GetIntById(prop_id, val))		{		    (*ppIHXValuesValues)->SetPropertyULONG32		    (			propSubName, 			val		    );		}		break;	    }	    case PT_STRING:	    {		if(HXR_OK == spregRegistry->GetStrById(prop_id,						   pBuffer))		{		    (*ppIHXValuesValues)->SetPropertyCString		    (			propSubName,			pBuffer		    );		    HX_RELEASE(pBuffer);		}		break;	    }	    case PT_BUFFER:	    {		if(HXR_OK == spregRegistry->GetBufById(prop_id,						   pBuffer))		{		    (*ppIHXValuesValues)->SetPropertyBuffer		    (			propSubName,			pBuffer		    );		    HX_RELEASE(pBuffer);		}		break;	    }	    default:		break;	}	res = pIHXValuesPNRegList->GetNextPropertyULONG32(propName, prop_id);    }    // Pass on the realm    if    (	SUCCEEDED	(	    m_spIHXValuesConfig->GetPropertyCString	    (		"Realm",		spIHXBufferRealm.ptr_reference()	    )	)    )    {	(*ppIHXValuesValues)->SetPropertyCString	(	    "Realm",	    spIHXBufferRealm	);    }    return HXR_OK;}/* XXXkshoop version for new plugin handler!HX_RESULTCServerAuthenticator::_CreatePlugin(    IHXBuffer* pIHXBufferPluginID,    IHXValues* pIHXValuesPluginProperties,    IUnknown** ppIUnknownPlugin){    DECLARE_SMART_POINTER    (	IHXServerAuthConversation    )					spIHXServerAuthConversationPlugin;    DECLARE_SMART_POINTER    (	IHXObjectConfiguration    )					spIHXObjectConfigurationPlugin;    DECLARE_SMART_POINTER(IHXValues)	spIHXValuesPluginValues;    IHXPlugin2Handler*			pIHXPlugin2HandlerSource = NULL;    HX_RESULT				HX_RESULTRet = HXR_FAIL;    m_spIUnknownContext->QueryInterface    (	IID_IHXPlugin2Handler,	(void**)&pIHXPlugin2HandlerSource    );    if(pIHXPlugin2HandlerSource)    {	pIHXPlugin2HandlerSource->FindPluginUsingStrings	(	    "PluginID", 	    (char*)pIHXBufferPluginID->GetBuffer(), 	    NULL, 	    NULL, 	    NULL, 	    NULL, 	    (*ppIUnknownPlugin)	);	// Double Check to make sure this is a ServerAuthenticator plugin	spIHXServerAuthConversationPlugin = (*ppIUnknownPlugin);	if(spIHXServerAuthConversationPlugin.IsValid())	{	    spIHXObjectConfigurationPlugin = (*ppIUnknownPlugin);	    // Initialize it	    _ValuesFromHXRegList	    (		pIHXValuesPluginProperties,		&spIHXValuesPluginValues	    );	    spIHXObjectConfigurationPlugin->SetConfiguration	    (		spIHXValuesPluginValues	    );	    HX_RESULTRet = HXR_OK;	}	else	{	    HX_RELEASE(*ppIUnknownPlugin);	}    }    HX_RELEASE(pIHXPlugin2HandlerSource);    return HX_RESULTRet;}*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -