示例#1
0
HRESULT HrInstallComponent(
	IN INetCfg* pnc,
	IN LPCTSTR szComponentId,
	IN const GUID* pguidClass
) {
	INetCfgClassSetup   *pncClassSetup = NULL;
	INetCfgComponent    *pncc = NULL;
	OBO_TOKEN           OboToken;
	HRESULT             hr = S_OK;

	//
	// OBO_TOKEN specifies on whose behalf this
	// component is being installed.
	// Set it to OBO_USER so that szComponentId will be installed
	// on behalf of the user.
	//

	ZeroMemory(&OboToken,
		sizeof(OboToken));
	OboToken.Type = OBO_USER;

	//
	// Get component's setup class reference.
	//
	hr = pnc->QueryNetCfgClass(pguidClass,
		IID_INetCfgClassSetup,
		(void**)&pncClassSetup);

	if (hr == S_OK) {
		hr = pncClassSetup->Install(szComponentId,
			&OboToken,
			0,
			0,       // Upgrade from build number.
			NULL,    // Answerfile name
			NULL,    // Answerfile section name
			&pncc); // Reference after the component
		if (S_OK == hr) {                   // is installed.

											//
											// we don't need to use pncc (INetCfgComponent), release it
											//

			ReleaseRef(pncc);
		}

		ReleaseRef(pncClassSetup);
	}

	return hr;
}
示例#2
0
HRESULT HrGetComponentEnum (INetCfg* pnc,
                            IN const GUID* pguidClass,
                            OUT IEnumNetCfgComponent **ppencc)
{
    INetCfgClass  *pncclass;
    HRESULT       hr;

    *ppencc = NULL;

    //
    // Get the class reference.
    //

    hr = pnc->QueryNetCfgClass( pguidClass,
                                IID_INetCfgClass,
                                (PVOID *)&pncclass );

    if ( hr == S_OK ) {

        //
        // Get the enumerator reference.
        //

        hr = pncclass->EnumComponents( ppencc );

        //
        // We don't need the class reference any more.
        //

        ReleaseRef( pncclass );
    }

    return hr;
}
示例#3
0
	void LogoutRequest::Release()
	{
		if(!ReleaseRef())
		{
			delete this;
		}
	}
示例#4
0
	void GFieldsImpl::Release()
	{
		if(ReleaseRef()<=0)
		{
			delete this;
		}
	}
示例#5
0
	void ServiceImpl::Release()
	{
		if(ReleaseRef()==0)
		{
			delete this;
		}
	}
示例#6
0
HRESULT HrGetBindingPathEnum (IN INetCfgComponent *pncc,
                              IN DWORD dwBindingType,
                              OUT IEnumNetCfgBindingPath **ppencbp)
{
    INetCfgComponentBindings *pnccb = NULL;
    HRESULT                  hr;

    *ppencbp = NULL;

    //
    // Get component's binding.
    //

    hr = pncc->QueryInterface( IID_INetCfgComponentBindings,
                               (PVOID *)&pnccb );

    if ( hr == S_OK ) {

        //
        // Get binding path enumerator reference.
        //

        hr = pnccb->EnumBindingPaths( dwBindingType,
                                      ppencbp );

        ReleaseRef( pnccb );
    }

    return hr;
}
	void WebExceptionResponseImpl::Release()
	{
		if(ReleaseRef()==0)
		{
			delete this;
		}
	}
示例#8
0
	void IDFilterImpl::Release()
	{
		if(ReleaseRef()<=0)
		{
			delete this;
		}
	}
示例#9
0
VError VJSONObject::Clone( VJSONValue& outValue, VJSONCloner& inCloner) const
{
	VError err = VE_OK;
	EJSONStatus status = EJSON_unhandled;

	if (fImpl != NULL)
	{
		status = fImpl->IJSON_Clone( this, inCloner, outValue, &err);
	}
	
	if (status == EJSON_unhandled)
	{
		VJSONObject *clone = new VJSONObject();
		if (clone != NULL)
		{
			err = CloneProperties( inCloner, clone);
		}
		else
		{
			err = VE_MEMORY_FULL;
		}
		outValue.SetObject( clone);
		ReleaseRef( &clone);
	}

	return err;
}
示例#10
0
void ClientConn::Close()
{
	if (m_handle != NETLIB_INVALID_HANDLE) {
		netlib_close(m_handle);
	}
	ReleaseRef();
}
示例#11
0
	void
	operator()(
		__in TYPE* obj
		)
	{
		ReleaseRef(obj);
	}
示例#12
0
			void ALSound::UpdateSound(){
	
				if(	m_pParentNode	!=	NULL	&&
					m_Info.type		==	enDynamic)
				{
	
					Float3	vPos	=	m_pParentNode->GetGlobalPosition();
					static	Real*	pTimeDelta	=	&GetGlobalSetting().m_ShaderParam.m_fTimeDelta;
					Float3	vVelocity	=	Float3(0,0,0);
 					if(*pTimeDelta!=0.0f)
 						vVelocity	=	(vPos	-	m_vLastPosition)/(*pTimeDelta);
	
					alSource3f(m_uiSource,AL_POSITION,vPos.x,vPos.y,vPos.z);
					alSource3f(m_uiSource,AL_VELOCITY,vVelocity.x,vVelocity.y,vVelocity.z);
					m_vLastPosition	=	vPos;
				}
	
				if(GetState()	==	AL_STOPPED){
					if(m_Info.iNumRepeat>=0)
						Play();
					else{
						if(m_pParentNode!=NULL){
							GetParentSceneNode()->detachObject(this);
						}
						ReleaseRef();
						return;
					}
				}
	
			}
示例#13
0
void MSection::Unlock(BOOL abExclusive)
{
	DWORD dwTID = GetCurrentThreadId();

	if (abExclusive)
	{
		//Process_Lock();

		_ASSERTEX(mn_TID == dwTID && mb_Exclusive);
		_ASSERTEX(mn_LockedTID[0] == dwTID);
		#ifdef _DEBUG
		mn_UnlockedExclusiveTID = dwTID;
		#endif
		mb_Exclusive = FALSE; mn_TID = 0;
		mn_LockedTID[0] = 0;
		if (mn_LockedCount[0] > 0)
		{
			mn_LockedCount[0] --; // на [0] mn_Locked не распространяется
		}
		else
		{
			_ASSERTEX(mn_LockedCount[0]>0);
		}
		m_cs.Leave();

		//Process_Unlock();
	}
	else
	{
		ReleaseRef(dwTID);
	}
}
示例#14
0
void CRouteConn::Close()
{
	if (m_handle != NETLIB_INVALID_HANDLE) {
		netlib_close(m_handle);
		g_route_conn_map.erase(m_handle);
	}

	// remove all user info from this MessageServer
	UserStatMap_t::iterator it_old;
	for (UserStatMap_t::iterator it = g_rs_user_map.begin(); it != g_rs_user_map.end(); ) {
		it_old = it;
		it++;
        
		RouteConnMap_t::iterator conn_it = it_old->second.conns.find(this);
		if (conn_it != it_old->second.conns.end()) {
			it_old->second.conns.erase(conn_it);
            
			if (it_old->second.conns.empty()) {
				g_rs_user_map.erase(it_old);
			}
		}
	}

	ReleaseRef();
}
示例#15
0
	void FeatureShp::Release()
	{
		if(!ReleaseRef())
		{
			delete this;
		}
	}
void ClientSession::DisconnectCompletion(DisconnectReason dr)
{
	printf_s("[DEBUG] Client Disconnected: Reason=%d IP=%s, PORT=%d \n", dr, inet_ntoa(mClientAddr.sin_addr), ntohs(mClientAddr.sin_port));

	/// release refcount when added at issuing a session
	ReleaseRef();
}
示例#17
0
	void FerryRegionSymbolImpl::Release()
	{
		if(!ReleaseRef())
		{
			delete this;
		}
	}
示例#18
0
	void PropertyNameImpl::Release()
	{
		if(ReleaseRef()<=0)
		{
			delete this;
		}
	}
示例#19
0
	void EnumDataSetImpl::Release()
	{
		if(!ReleaseRef())
		{
			delete this;
		}
	}
示例#20
0
	void LiteralImpl::Release()
	{
		if(ReleaseRef()<=0)
		{
			delete this;
		}
	}
示例#21
0
	void TriangleMarkerImpl::Release()
	{
		if(!ReleaseRef())
		{
			delete this;
		}
	}
示例#22
0
void ClientSession::Disconnect(DisconnectReason dr)
{
	FastSpinlockGuard criticalSection(mSessionLock);

	if ( !IsConnected() )
		return ;
	
	LINGER lingerOption ;
	lingerOption.l_onoff = 1;
	lingerOption.l_linger = 0;

	/// no TCP TIME_WAIT
	if (SOCKET_ERROR == setsockopt(mSocket, SOL_SOCKET, SO_LINGER, (char*)&lingerOption, sizeof(LINGER)) )
	{
		printf_s("[DEBUG] setsockopt linger option error: %d\n", GetLastError());
	}

	printf_s("[DEBUG] Client Disconnected: Reason=%d IP=%s, PORT=%d \n", dr, inet_ntoa(mClientAddr.sin_addr), ntohs(mClientAddr.sin_port));
	
	closesocket(mSocket) ;

	mConnected = false ;
	mSocket = NULL;

	ReleaseRef();
}
示例#23
0
void CHttpConn::Close()
{
    m_state = CONN_STATE_CLOSED;

    g_http_conn_map.erase(m_conn_handle);
    netlib_close(m_sock_handle);

    ReleaseRef();
}
示例#24
0
int CBaseSocket::Close()
{
    CEventDispatch::Instance()->RemoveEvent(m_socket, SOCKET_ALL);
    RemoveBaseSocket(this);
    closesocket(m_socket);
    ReleaseRef();
    
    return 0;
}
示例#25
0
void ClientConn::Close()
{
	log("clientconn close from handle = %d\n", m_handle);
	if (m_handle != NETLIB_INVALID_HANDLE) {
		netlib_close(m_handle);
		g_client_conn_map.erase(m_handle);
	}
	ReleaseRef();
}
示例#26
0
HRESULT HrReleaseINetCfg(
	IN INetCfg* pnc,
	IN BOOL fHasWriteLock
) {
	INetCfgLock    *pncLock = NULL;
	HRESULT        hr = S_OK;

	//
	// Uninitialize INetCfg
	//

	hr = pnc->Uninitialize();

	//
	// If write lock is present, unlock it
	//

	if (hr == S_OK && fHasWriteLock) {

		//
		// Get the locking reference
		//

		hr = pnc->QueryInterface(IID_INetCfgLock,
			(LPVOID *)&pncLock);
		if (hr == S_OK) {
			hr = pncLock->ReleaseWriteLock();
			ReleaseRef(pncLock);
		}
	}

	ReleaseRef(pnc);

	//
	// Uninitialize COM.
	//

	CoUninitialize();

	return hr;
}
示例#27
0
void CHttpConn::Close()
{
    if (m_state != CONN_STATE_CLOSED) {
        m_state = CONN_STATE_CLOSED;

        g_httpConnMap.erase(m_sockHandle);
        g_uuidConnMap.erase(m_uuid);
        netlib_close(m_sockHandle);

        ReleaseRef();
    }
}
示例#28
0
void CDBServConn::Close()
{
	// reset server information for the next connect
	serv_reset<CDBServConn>(g_db_server_list, g_db_server_count, m_serv_idx);

	if (m_handle != NETLIB_INVALID_HANDLE) {
		netlib_close(m_handle);
		g_db_server_conn_map.erase(m_handle);
	}

	ReleaseRef();
}
示例#29
0
HRESULT HrFindNetComponentByPnpId (IN INetCfg *pnc,
                                   IN __in LPWSTR lpszPnpDevNodeId,
                                   OUT INetCfgComponent **ppncc)
{
    IEnumNetCfgComponent    *pencc;
    LPWSTR                  pszPnpId;
    HRESULT                 hr;
    BOOL                    fFound;

    hr = HrGetComponentEnum( pnc,
                             &GUID_DEVCLASS_NET,
                             &pencc );
    if ( hr == S_OK ) {

        hr = HrGetFirstComponent( pencc, ppncc );
        fFound = FALSE;
        while( hr == S_OK ) {
            hr = (*ppncc)->GetPnpDevNodeId( &pszPnpId );
            if ( hr == S_OK ) {
                fFound = wcscmp( pszPnpId, lpszPnpDevNodeId ) == 0;
                CoTaskMemFree( pszPnpId );
                if ( fFound ) {
                    break;
                }
            }
            else {
                hr = S_OK;
            }

            ReleaseRef( *ppncc );
            hr = HrGetNextComponent( pencc, ppncc );
        }

        ReleaseRef( pencc );
    }

    return hr;
}
示例#30
0
void CRouteServConn::Close()
{
	serv_reset<CRouteServConn>(g_route_server_list, g_route_server_count, m_serv_idx);

	m_bOpen = false;
	if (m_handle != NETLIB_INVALID_HANDLE) {
		netlib_close(m_handle);
		g_route_server_conn_map.erase(m_handle);
	}

	ReleaseRef();

	if (g_master_rs_conn == this) {
		update_master_route_serv_conn();
	}
}