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; }
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; }
void LogoutRequest::Release() { if(!ReleaseRef()) { delete this; } }
void GFieldsImpl::Release() { if(ReleaseRef()<=0) { delete this; } }
void ServiceImpl::Release() { if(ReleaseRef()==0) { delete this; } }
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; } }
void IDFilterImpl::Release() { if(ReleaseRef()<=0) { delete this; } }
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; }
void ClientConn::Close() { if (m_handle != NETLIB_INVALID_HANDLE) { netlib_close(m_handle); } ReleaseRef(); }
void operator()( __in TYPE* obj ) { ReleaseRef(obj); }
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; } } }
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); } }
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(); }
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(); }
void FerryRegionSymbolImpl::Release() { if(!ReleaseRef()) { delete this; } }
void PropertyNameImpl::Release() { if(ReleaseRef()<=0) { delete this; } }
void EnumDataSetImpl::Release() { if(!ReleaseRef()) { delete this; } }
void LiteralImpl::Release() { if(ReleaseRef()<=0) { delete this; } }
void TriangleMarkerImpl::Release() { if(!ReleaseRef()) { delete this; } }
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(); }
void CHttpConn::Close() { m_state = CONN_STATE_CLOSED; g_http_conn_map.erase(m_conn_handle); netlib_close(m_sock_handle); ReleaseRef(); }
int CBaseSocket::Close() { CEventDispatch::Instance()->RemoveEvent(m_socket, SOCKET_ALL); RemoveBaseSocket(this); closesocket(m_socket); ReleaseRef(); return 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(); }
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; }
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(); } }
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(); }
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; }
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(); } }