static ULONG WINAPI BindProtocol_Release(IInternetProtocol *iface) { BindProtocol *This = PROTOCOL_THIS(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { if(This->wininet_info) IWinInetInfo_Release(This->wininet_info); if(This->protocol) IInternetProtocol_Release(This->protocol); if(This->bind_info) IInternetBindInfo_Release(This->bind_info); if(This->protocol_handler && This->protocol_handler != PROTOCOLHANDLER(This)) IInternetProtocol_Release(This->protocol_handler); if(This->filter_proxy) IInternetProtocol_Release(PROTOCOL(This->filter_proxy)); set_binding_sink(PROTOCOL(This), NULL); if(This->notif_hwnd) release_notif_hwnd(This->notif_hwnd); DeleteCriticalSection(&This->section); heap_free(This->mime); heap_free(This->url); heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI Binding_Release(IBinding* iface) { Binding *This = (Binding*)iface; ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n",This, ref); if(!ref) { heap_free(This->URLName); if (This->hCacheFile) CloseHandle(This->hCacheFile); if (This->pstrCache) { UMCloseCacheFileStream(This->pstrCache); IStream_Release((IStream *)This->pstrCache); } if (This->pbscb) IBindStatusCallback_Release(This->pbscb); heap_free(This); URLMON_UnlockModule(); } return ref; }
static HRESULT WINAPI CF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { TRACE("(%d)\n", dolock); if (dolock) URLMON_LockModule(); else URLMON_UnlockModule(); return S_OK; }
static ULONG WINAPI GopherProtocol_Release(IInternetProtocol *iface) { GopherProtocol *This = PROTOCOL_THIS(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI MimeFilterProtocol_Release(IInternetProtocol *iface) { MimeFilter *This = impl_from_IInternetProtocol(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI EnumFORMATETC_Release(IEnumFORMATETC *iface) { ENUMF_THIS(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { heap_free(This->fetc); heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI FtpProtocol_Release(IInternetProtocolEx *iface) { FtpProtocol *This = impl_from_IInternetProtocolEx(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { protocol_close_connection(&This->base); heap_free(This); URLMON_UnlockModule(); } return ref; }
/******************************************************************** * IInternetZoneManager_Release */ static ULONG WINAPI ZoneMgrImpl_Release(IInternetZoneManagerEx2* iface) { ZoneMgrImpl* This = impl_from_IInternetZoneManagerEx2(iface); ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p)->(ref before=%u)\n",This, refCount + 1); if(!refCount) { while (This->zonemap_count) heap_free(This->zonemaps[--This->zonemap_count]); heap_free(This->zonemaps); heap_free(This); URLMON_UnlockModule(); } return refCount; }
static ULONG WINAPI ProtocolStream_Release(IStream *iface) { ProtocolStream *This = STREAM_THIS(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { IUnknown_Release(STGMEDUNK(This->buf)); heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI ProtocolStream_Release(IStream *iface) { ProtocolStream *This = impl_from_IStream(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { IUnknown_Release(&This->buf->IUnknown_iface); heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI FileProtocol_Release(IInternetProtocolEx *iface) { FileProtocol *This = impl_from_IInternetProtocolEx(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { if(This->file != INVALID_HANDLE_VALUE) CloseHandle(This->file); heap_free(This); URLMON_UnlockModule(); } return ref; }
/****************************************************************************** * URLMoniker_Release ******************************************************************************/ static ULONG WINAPI URLMonikerImpl_Release(IMoniker* iface) { URLMonikerImpl *This = (URLMonikerImpl *)iface; ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%u\n",This, refCount); /* destroy the object if there's no more reference on it */ if (!refCount) { heap_free(This->URLName); heap_free(This); URLMON_UnlockModule(); } return refCount; }
static ULONG WINAPI MkProtocol_Release(IInternetProtocolEx *iface) { MkProtocol *This = impl_from_IInternetProtocolEx(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { if(This->stream) IStream_Release(This->stream); heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI URLMoniker_Release(IMoniker *iface) { URLMoniker *This = impl_from_IMoniker(iface); ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%u\n",This, refCount); if (!refCount) { if(This->uri) IUri_Release(This->uri); SysFreeString(This->URLName); heap_free(This); URLMON_UnlockModule(); } return refCount; }
static ULONG WINAPI StgMedUnk_Release(IUnknown *iface) { stgmed_buf_t *This = STGMEDUNK_THIS(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { if(This->file != INVALID_HANDLE_VALUE) CloseHandle(This->file); IInternetProtocol_Release(This->protocol); heap_free(This->cache_file); heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI ProtocolProxy_Release(IInternetProtocol *iface) { ProtocolProxy *This = PROTOCOL_THIS(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { if(This->protocol_sink) IInternetProtocolSink_Release(This->protocol_sink); if(This->protocol) IInternetProtocol_Release(This->protocol); heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI Binding_Release(IBinding *iface) { Binding *This = BINDING_THIS(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { if(This->notif_hwnd) release_notif_hwnd(This->notif_hwnd); if(This->mon) IMoniker_Release(This->mon); if(This->callback) IBindStatusCallback_Release(This->callback); if(This->protocol) IInternetProtocol_Release(This->protocol); if(This->service_provider) IServiceProvider_Release(This->service_provider); if(This->stgmed_buf) IUnknown_Release(STGMEDUNK(This->stgmed_buf)); if(This->stgmed_obj) This->stgmed_obj->vtbl->release(This->stgmed_obj); if(This->obj) IUnknown_Release(This->obj); if(This->bctx) IBindCtx_Release(This->bctx); ReleaseBindInfo(&This->bindinfo); This->section.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->section); heap_free(This->mime); heap_free(This->redirect_url); heap_free(This->url); heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI SecManagerImpl_Release(IInternetSecurityManager* iface) { SecManagerImpl *This = impl_from_IInternetSecurityManager(iface); ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%u\n", This, refCount); /* destroy the object if there's no more reference on it */ if (!refCount){ if(This->mgrsite) IInternetSecurityMgrSite_Release(This->mgrsite); if(This->custom_manager) IInternetSecurityManager_Release(This->custom_manager); heap_free(This); URLMON_UnlockModule(); } return refCount; }
static ULONG WINAPI BindProtocol_Release(IInternetProtocol *iface) { BindProtocol *This = PROTOCOL_THIS(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { if(This->protocol) IInternetProtocol_Release(This->protocol); if(This->bind_info) IInternetBindInfo_Release(This->bind_info); set_binding_sink(PROTOCOL(This), NULL); heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI BindProtocol_Release(IInternetProtocolEx *iface) { BindProtocol *This = impl_from_IInternetProtocolEx(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { if(This->wininet_info) IWinInetInfo_Release(This->wininet_info); if(This->wininet_http_info) IWinInetHttpInfo_Release(This->wininet_http_info); if(This->protocol) IInternetProtocol_Release(This->protocol); if(This->bind_info) IInternetBindInfo_Release(This->bind_info); if(This->protocol_handler && This->protocol_handler != &This->default_protocol_handler.IInternetProtocol_iface) IInternetProtocol_Release(This->protocol_handler); if(This->protocol_sink_handler && This->protocol_sink_handler != &This->default_protocol_handler.IInternetProtocolSink_iface) IInternetProtocolSink_Release(This->protocol_sink_handler); if(This->uri) IUri_Release(This->uri); SysFreeString(This->display_uri); set_binding_sink(This, NULL, NULL); if(This->notif_hwnd) release_notif_hwnd(This->notif_hwnd); This->section.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->section); heap_free(This->mime); heap_free(This); URLMON_UnlockModule(); } return ref; }
static ULONG WINAPI InternetSession_Release(IInternetSession *iface) { TRACE("()\n"); URLMON_UnlockModule(); return 1; }
static ULONG WINAPI CF_Release(IClassFactory *iface) { URLMON_UnlockModule(); return 1; }