From 7ad8d2e54c36962f1379d245398dc2f9d52ee600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Wed, 17 Jun 2009 00:29:40 +0400 Subject: [PATCH] Replaced deprecated win32-compatibility function with undeprecated one. Fixes #560442. --- gst/gst.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gst/gst.c b/gst/gst.c index 942bc67750..5dfe64cffa 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -135,6 +135,10 @@ static gboolean gst_initialized = FALSE; static gboolean gst_deinitialized = FALSE; +#ifdef G_OS_WIN32 +static HMODULE gst_dll_handle = NULL; +#endif + #ifndef GST_DISABLE_REGISTRY static GList *plugin_paths = NULL; /* for delayed processing in post_init */ #endif @@ -284,6 +288,16 @@ parse_debug_list (const gchar * list) } #endif +#ifdef G_OS_WIN32 +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + if (fdwReason == DLL_PROCESS_ATTACH) + gst_dll_handle = (HMODULE) hinstDLL; + return TRUE; +} + +#endif + /** * gst_init_get_option_group: * @@ -728,8 +742,8 @@ scan_and_update_registry (GstRegistry * default_registry, char *base_dir; char *dir; - base_dir = g_win32_get_package_installation_directory (NULL, - "libgstreamer-0.10-0.dll"); + base_dir = g_win32_get_package_installation_directory_of_module ( + gst_dll_handle); dir = g_build_filename (base_dir, "lib", "gstreamer-0.10", NULL); GST_DEBUG ("scanning DLL dir %s", dir);