Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/quartz/acmwrapper.c | 2 -- dlls/quartz/avidec.c | 2 -- dlls/quartz/dsoundrender.c | 2 -- dlls/quartz/filesource.c | 2 -- dlls/quartz/filtergraph.c | 2 -- dlls/quartz/filtermapper.c | 2 -- dlls/quartz/main.c | 24 ++---------------------- dlls/quartz/memallocator.c | 2 -- dlls/quartz/passthrough.c | 2 -- dlls/quartz/quartz_private.h | 2 -- dlls/quartz/systemclock.c | 2 -- dlls/quartz/videorenderer.c | 2 -- dlls/quartz/vmr9.c | 10 ++-------- 13 files changed, 4 insertions(+), 52 deletions(-)
diff --git a/dlls/quartz/acmwrapper.c b/dlls/quartz/acmwrapper.c index 81e856a00df..a07bdfef0ca 100644 --- a/dlls/quartz/acmwrapper.c +++ b/dlls/quartz/acmwrapper.c @@ -484,8 +484,6 @@ static void acm_wrapper_destroy(struct strmbase_filter *iface) FreeMediaType(&filter->mt); strmbase_filter_cleanup(&filter->filter); free(filter); - - InterlockedDecrement(&object_locks); }
static HRESULT acm_wrapper_init_stream(struct strmbase_filter *iface) diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c index b1e07fe5879..3d947e1b1bf 100644 --- a/dlls/quartz/avidec.c +++ b/dlls/quartz/avidec.c @@ -538,8 +538,6 @@ static void avi_decompressor_destroy(struct strmbase_filter *iface)
strmbase_filter_cleanup(&filter->filter); free(filter); - - InterlockedDecrement(&object_locks); }
static HRESULT avi_decompressor_init_stream(struct strmbase_filter *iface) diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 68c88ea5a15..9ecdb280cc6 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -549,8 +549,6 @@ static void dsound_render_destroy(struct strmbase_filter *iface) strmbase_passthrough_cleanup(&filter->passthrough); strmbase_filter_cleanup(&filter->filter); free(filter); - - InterlockedDecrement(&object_locks); }
static struct strmbase_pin *dsound_render_get_pin(struct strmbase_filter *iface, unsigned int index) diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index cf5fe457715..e5e7b482984 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -351,8 +351,6 @@ static void async_reader_destroy(struct strmbase_filter *iface)
strmbase_filter_cleanup(&filter->filter); free(filter); - - InterlockedDecrement(&object_locks); }
static HRESULT async_reader_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index a1f3757a202..47b9da9510b 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -475,8 +475,6 @@ static ULONG WINAPI FilterGraphInner_Release(IUnknown *iface) DeleteCriticalSection(&This->event_cs); DeleteCriticalSection(&This->cs); free(This); - - InterlockedDecrement(&object_locks); } return ref; } diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c index b3210fdcd59..230273891d4 100644 --- a/dlls/quartz/filtermapper.c +++ b/dlls/quartz/filtermapper.c @@ -487,8 +487,6 @@ static ULONG WINAPI Inner_Release(IUnknown *iface) if (ref == 0) { CoTaskMemFree(This); - - InterlockedDecrement(&object_locks); }
return ref; diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 303cc30a931..ed7080b76b9 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -24,11 +24,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz);
extern HRESULT WINAPI QUARTZ_DllGetClassObject(REFCLSID, REFIID, LPVOID *) DECLSPEC_HIDDEN; -extern HRESULT WINAPI QUARTZ_DllCanUnloadNow(void) DECLSPEC_HIDDEN; extern BOOL WINAPI QUARTZ_DllMain(HINSTANCE, DWORD, LPVOID) DECLSPEC_HIDDEN;
-LONG object_locks = 0; - BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { if (reason == DLL_PROCESS_DETACH && !reserved) @@ -127,21 +124,15 @@ static HRESULT WINAPI DSCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter
if (SUCCEEDED(hres = This->create_instance(pOuter, &punk))) { - InterlockedIncrement(&object_locks); hres = IUnknown_QueryInterface(punk, riid, ppobj); IUnknown_Release(punk); } return hres; }
-static HRESULT WINAPI DSCF_LockServer(IClassFactory *iface, BOOL dolock) +static HRESULT WINAPI DSCF_LockServer(IClassFactory *iface, BOOL lock) { - IClassFactoryImpl *This = impl_from_IClassFactory(iface); - FIXME("(%p)->(%d),stub!\n",This,dolock); - if(dolock) - InterlockedIncrement(&object_locks); - else - InterlockedDecrement(&object_locks); + FIXME("iface %p, lock %d, stub!\n", iface, lock); return S_OK; }
@@ -199,17 +190,6 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) return QUARTZ_DllGetClassObject( rclsid, riid, ppv ); }
-/*********************************************************************** - * DllCanUnloadNow (QUARTZ.@) - */ -HRESULT WINAPI DllCanUnloadNow(void) -{ - if (!object_locks && QUARTZ_DllCanUnloadNow() == S_OK) - return S_OK; - return S_FALSE; -} - - #define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } , #name },
diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c index cc13f776cfb..531fbe874cf 100644 --- a/dlls/quartz/memallocator.c +++ b/dlls/quartz/memallocator.c @@ -911,8 +911,6 @@ static void StdMemAllocator_Destroy(IMemAllocator *iface) DeleteCriticalSection(&This->csState);
CoTaskMemFree(This); - - InterlockedDecrement(&object_locks); }
HRESULT mem_allocator_create(IUnknown *lpUnkOuter, IUnknown **out) diff --git a/dlls/quartz/passthrough.c b/dlls/quartz/passthrough.c index 7f81ae8a1be..2f8fe9dc370 100644 --- a/dlls/quartz/passthrough.c +++ b/dlls/quartz/passthrough.c @@ -80,8 +80,6 @@ static ULONG WINAPI seeking_passthrough_Release(IUnknown *iface) { strmbase_passthrough_cleanup(&passthrough->passthrough); free(passthrough); - - InterlockedDecrement(&object_locks); } return refcount; } diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index de83c2535db..c706d906a26 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -58,8 +58,6 @@ static inline const char *debugstr_time(REFERENCE_TIME time) return wine_dbg_sprintf("%s", rev); }
-extern LONG object_locks; - /* see IAsyncReader::Request on MSDN for the explanation of this */ #define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000) #define BYTES_FROM_MEDIATIME(time) ((time) / 10000000) diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c index 73a923a7b99..cebe4846f04 100644 --- a/dlls/quartz/systemclock.c +++ b/dlls/quartz/systemclock.c @@ -115,8 +115,6 @@ static ULONG WINAPI system_clock_inner_Release(IUnknown *iface) clock->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&clock->cs); heap_free(clock); - - InterlockedDecrement(&object_locks); } return refcount; } diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 1a59a9b5213..1dbb8a02181 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -130,8 +130,6 @@ static void video_renderer_destroy(struct strmbase_renderer *iface) video_window_cleanup(&filter->window); strmbase_renderer_cleanup(&filter->renderer); free(filter); - - InterlockedDecrement(&object_locks); }
static HRESULT video_renderer_query_interface(struct strmbase_renderer *iface, REFIID iid, void **out) diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 2562b74932a..4bde811c6d7 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -528,12 +528,6 @@ static void vmr_disconnect(struct strmbase_renderer *This) } }
-static void vmr_free(struct quartz_vmr *filter) -{ - free(filter); - InterlockedDecrement(&object_locks); -} - static void vmr_destroy(struct strmbase_renderer *iface) { struct quartz_vmr *filter = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface); @@ -563,7 +557,7 @@ static void vmr_destroy(struct strmbase_renderer *iface) FreeLibrary(filter->hD3d9); strmbase_renderer_cleanup(&filter->renderer); if (!filter->IVMRSurfaceAllocatorNotify9_refcount) - vmr_free(filter); + free(filter); }
static HRESULT vmr_query_interface(struct strmbase_renderer *iface, REFIID iid, void **out) @@ -1955,7 +1949,7 @@ static ULONG WINAPI VMR9SurfaceAllocatorNotify_Release(IVMRSurfaceAllocatorNotif TRACE("%p decreasing refcount to %u.\n", iface, refcount);
if (!refcount && !filter->renderer.filter.refcount) - vmr_free(filter); + free(filter);
return refcount; }
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/qcap/avimux.c | 2 -- dlls/qcap/capturegraph.c | 2 -- dlls/qcap/qcap_main.c | 24 ------------------------ dlls/qcap/qcap_private.h | 2 -- dlls/qcap/vfwcapture.c | 2 -- 5 files changed, 32 deletions(-)
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index 5cc7d55bdf1..c3dbf71d2da 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -131,7 +131,6 @@ static void avi_mux_destroy(struct strmbase_filter *iface) free(filter->idx1); strmbase_filter_cleanup(&filter->filter); free(filter); - ObjectRefCount(FALSE); }
static HRESULT avi_mux_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) @@ -1851,7 +1850,6 @@ HRESULT avi_mux_create(IUnknown *outer, IUnknown **out) avimux->interleave = 10000000;
TRACE("Created AVI mux %p.\n", avimux); - ObjectRefCount(TRUE); *out = &avimux->filter.IUnknown_inner; return S_OK; } diff --git a/dlls/qcap/capturegraph.c b/dlls/qcap/capturegraph.c index e5c7d9c1120..157cfc6178d 100644 --- a/dlls/qcap/capturegraph.c +++ b/dlls/qcap/capturegraph.c @@ -66,7 +66,6 @@ HRESULT capture_graph_create(IUnknown *outer, IUnknown **out) object->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": CaptureGraphImpl.csFilter");
TRACE("Created capture graph builder %p.\n", object); - ObjectRefCount(TRUE); *out = (IUnknown *)&object->ICaptureGraphBuilder_iface; return S_OK; } @@ -123,7 +122,6 @@ static ULONG WINAPI fnCaptureGraphBuilder2_Release(ICaptureGraphBuilder2 * iface if (This->mygraph) IGraphBuilder_Release(This->mygraph); free(This); - ObjectRefCount(FALSE); } return ref; } diff --git a/dlls/qcap/qcap_main.c b/dlls/qcap/qcap_main.c index ac7ac6a26aa..3a8c89fe077 100644 --- a/dlls/qcap/qcap_main.c +++ b/dlls/qcap/qcap_main.c @@ -29,8 +29,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz);
HINSTANCE qcap_instance;
-static LONG objects_ref = 0; - struct class_factory { IClassFactory IClassFactory_iface; @@ -91,11 +89,6 @@ static HRESULT WINAPI class_factory_CreateInstance(IClassFactory *iface, IUnknow static HRESULT WINAPI class_factory_LockServer(IClassFactory *iface, BOOL lock) { TRACE("iface %p, lock %d.\n", iface, lock); - - if (lock) - InterlockedIncrement(&objects_ref); - else - InterlockedDecrement(&objects_ref); return S_OK; }
@@ -274,20 +267,3 @@ HRESULT WINAPI DllUnregisterServer(void) IFilterMapper2_Release(mapper); return S_OK; } - -/*********************************************************************** - * DllCanUnloadNow (QCAP.@) - */ -HRESULT WINAPI DllCanUnloadNow(void) -{ - TRACE(".\n"); - - return objects_ref ? S_FALSE : S_OK; -} - -DWORD ObjectRefCount(BOOL increment) -{ - if (increment) - return InterlockedIncrement(&objects_ref); - return InterlockedDecrement(&objects_ref); -} diff --git a/dlls/qcap/qcap_private.h b/dlls/qcap/qcap_private.h index 104dba6a649..2db3c509062 100644 --- a/dlls/qcap/qcap_private.h +++ b/dlls/qcap/qcap_private.h @@ -30,8 +30,6 @@
extern HINSTANCE qcap_instance DECLSPEC_HIDDEN;
-extern DWORD ObjectRefCount(BOOL increment) DECLSPEC_HIDDEN; - HRESULT audio_record_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; HRESULT avi_compressor_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; HRESULT avi_mux_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index fd5434434f2..504d41b5814 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -107,7 +107,6 @@ static void vfw_capture_destroy(struct strmbase_filter *iface) strmbase_source_cleanup(&filter->source); strmbase_filter_cleanup(&filter->filter); free(filter); - ObjectRefCount(FALSE); }
static HRESULT vfw_capture_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) @@ -861,7 +860,6 @@ HRESULT vfw_capture_create(IUnknown *outer, IUnknown **out) object->state_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": vfw_capture.state_cs");
TRACE("Created VFW capture filter %p.\n", object); - ObjectRefCount(TRUE); *out = &object->filter.IUnknown_inner; return S_OK; }
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/gst_private.h | 2 -- dlls/winegstreamer/main.c | 14 -------------- dlls/winegstreamer/mfplat.c | 6 ------ 3 files changed, 22 deletions(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 55a62361966..c6c99b1dd55 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -198,8 +198,6 @@ struct unix_funcs
extern const struct unix_funcs *unix_funcs;
-extern LONG object_locks; - HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; HRESULT decodebin_parser_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 9211a090cf1..6742724948e 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -27,8 +27,6 @@ #include "initguid.h" #include "gst_guids.h"
-LONG object_locks; - WINE_DEFAULT_DEBUG_CHANNEL(quartz);
const struct unix_funcs *unix_funcs = NULL; @@ -43,13 +41,6 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) return TRUE; }
-HRESULT WINAPI DllCanUnloadNow(void) -{ - TRACE(".\n"); - - return object_locks ? S_FALSE : S_OK; -} - struct class_factory { IClassFactory IClassFactory_iface; @@ -110,11 +101,6 @@ static HRESULT WINAPI class_factory_CreateInstance(IClassFactory *iface, IUnknow static HRESULT WINAPI class_factory_LockServer(IClassFactory *iface, BOOL lock) { TRACE("iface %p, lock %d.\n", iface, lock); - - if (lock) - InterlockedIncrement(&object_locks); - else - InterlockedDecrement(&object_locks); return S_OK; }
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index dcbd03137ba..93f4b8d5bd7 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -354,12 +354,6 @@ static HRESULT WINAPI class_factory_CreateInstance(IClassFactory *iface, IUnknow static HRESULT WINAPI class_factory_LockServer(IClassFactory *iface, BOOL dolock) { TRACE("%p, %d.\n", iface, dolock); - - if (dolock) - InterlockedIncrement(&object_locks); - else - InterlockedDecrement(&object_locks); - return S_OK; }
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/devenum/createdevenum.c | 4 ---- dlls/devenum/devenum_main.c | 17 +---------------- dlls/devenum/devenum_private.h | 7 ------- dlls/devenum/mediacatenum.c | 10 ---------- dlls/devenum/parsedisplayname.c | 4 ---- 5 files changed, 1 insertion(+), 41 deletions(-)
diff --git a/dlls/devenum/createdevenum.c b/dlls/devenum/createdevenum.c index 8e9cf56eb09..bec462e0f5a 100644 --- a/dlls/devenum/createdevenum.c +++ b/dlls/devenum/createdevenum.c @@ -64,8 +64,6 @@ static ULONG WINAPI devenum_factory_AddRef(ICreateDevEnum *iface) { TRACE("\n");
- DEVENUM_LockModule(); - return 2; /* non-heap based object */ }
@@ -73,8 +71,6 @@ static ULONG WINAPI devenum_factory_Release(ICreateDevEnum *iface) { TRACE("\n");
- DEVENUM_UnlockModule(); - return 1; /* non-heap based object */ }
diff --git a/dlls/devenum/devenum_main.c b/dlls/devenum/devenum_main.c index cbeacbb5b27..87939749121 100644 --- a/dlls/devenum/devenum_main.c +++ b/dlls/devenum/devenum_main.c @@ -25,8 +25,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
-DECLSPEC_HIDDEN LONG dll_refs; - struct class_factory { IClassFactory IClassFactory_iface; @@ -56,13 +54,11 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID i
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) { - DEVENUM_LockModule(); return 2; }
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) { - DEVENUM_UnlockModule(); return 1; }
@@ -82,10 +78,7 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface,
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL lock) { - if (lock) - DEVENUM_LockModule(); - else - DEVENUM_UnlockModule(); + TRACE("iface %p, lock %d.\n", iface, lock); return S_OK; }
@@ -118,14 +111,6 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **obj) return CLASS_E_CLASSNOTAVAILABLE; }
-/*********************************************************************** - * DllCanUnloadNow (DEVENUM.@) - */ -HRESULT WINAPI DllCanUnloadNow(void) -{ - return dll_refs != 0 ? S_FALSE : S_OK; -} - /*********************************************************************** * DllRegisterServer (DEVENUM.@) */ diff --git a/dlls/devenum/devenum_private.h b/dlls/devenum/devenum_private.h index 15c41afd570..adc9b377d09 100644 --- a/dlls/devenum/devenum_private.h +++ b/dlls/devenum/devenum_private.h @@ -27,13 +27,6 @@ #include "dmo.h" #include "dmodshow.h"
-/********************************************************************** - * Dll lifetime tracking declaration for devenum.dll - */ -extern LONG dll_refs DECLSPEC_HIDDEN; -static inline void DEVENUM_LockModule(void) { InterlockedIncrement(&dll_refs); } -static inline void DEVENUM_UnlockModule(void) { InterlockedDecrement(&dll_refs); } - enum device_type { DEVICE_FILTER, diff --git a/dlls/devenum/mediacatenum.c b/dlls/devenum/mediacatenum.c index b24e24f7f31..9d8069a3aa2 100644 --- a/dlls/devenum/mediacatenum.c +++ b/dlls/devenum/mediacatenum.c @@ -414,7 +414,6 @@ static ULONG WINAPI moniker_Release(IMoniker *iface) if (ref == 0) { free(This->name); free(This); - DEVENUM_UnlockModule(); } return ref; } @@ -783,8 +782,6 @@ struct moniker *filter_moniker_create(const GUID *class, const WCHAR *name) object->has_class = !!class; object->name = wcsdup(name);
- DEVENUM_LockModule(); - return object; }
@@ -804,8 +801,6 @@ struct moniker *codec_moniker_create(const GUID *class, const WCHAR *name) object->has_class = !!class; object->name = wcsdup(name);
- DEVENUM_LockModule(); - return object; }
@@ -823,8 +818,6 @@ struct moniker *dmo_moniker_create(const GUID class, const GUID clsid) object->class = class; object->clsid = clsid;
- DEVENUM_LockModule(); - return object; }
@@ -879,7 +872,6 @@ static ULONG WINAPI enum_moniker_Release(IEnumMoniker *iface) RegCloseKey(This->sw_key); RegCloseKey(This->cm_key); free(This); - DEVENUM_UnlockModule(); return 0; } return ref; @@ -1070,7 +1062,5 @@ HRESULT enum_moniker_create(REFCLSID class, IEnumMoniker **out)
*out = &object->IEnumMoniker_iface;
- DEVENUM_LockModule(); - return S_OK; } diff --git a/dlls/devenum/parsedisplayname.c b/dlls/devenum/parsedisplayname.c index f24b4329c80..477f2f3d11e 100644 --- a/dlls/devenum/parsedisplayname.c +++ b/dlls/devenum/parsedisplayname.c @@ -51,8 +51,6 @@ static ULONG WINAPI devenum_parser_AddRef(IParseDisplayName *iface) { TRACE("\n");
- DEVENUM_LockModule(); - return 2; /* non-heap based object */ }
@@ -60,8 +58,6 @@ static ULONG WINAPI devenum_parser_Release(IParseDisplayName *iface) { TRACE("\n");
- DEVENUM_UnlockModule(); - return 1; /* non-heap based object */ }