Commit f32b795e authored by Damien Fouilleul's avatar Damien Fouilleul

- activex: fix plugin path search, now relative to DLL location & registry settings

parent 2cfffefb
...@@ -51,13 +51,19 @@ extern const CATID CATID_SafeForScripting; ...@@ -51,13 +51,19 @@ extern const CATID CATID_SafeForScripting;
static LONG i_class_ref= 0; static LONG i_class_ref= 0;
static HINSTANCE h_instance= 0; static HINSTANCE h_instance= 0;
HMODULE DllGetModule()
{
return h_instance;
};
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{ {
HRESULT hr = CLASS_E_CLASSNOTAVAILABLE; HRESULT hr = CLASS_E_CLASSNOTAVAILABLE;
*ppv = NULL; *ppv = NULL;
if( CLSID_VLCPlugin2 == rclsid ) if( (CLSID_VLCPlugin == rclsid )
|| ( CLSID_VLCPlugin2 == rclsid) )
{ {
VLCPluginClass *plugin = new VLCPluginClass(&i_class_ref, h_instance, rclsid); VLCPluginClass *plugin = new VLCPluginClass(&i_class_ref, h_instance, rclsid);
hr = plugin->QueryInterface(riid, ppv); hr = plugin->QueryInterface(riid, ppv);
......
...@@ -549,6 +549,8 @@ HRESULT VLCPlugin::getVLCObject(int* i_vlc) ...@@ -549,6 +549,8 @@ HRESULT VLCPlugin::getVLCObject(int* i_vlc)
HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc) HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
{ {
extern HMODULE DllGetModule();
if( ! isRunning() ) if( ! isRunning() )
{ {
/* /*
...@@ -568,16 +570,21 @@ HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc) ...@@ -568,16 +570,21 @@ HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
{ {
if( i_type == REG_SZ ) if( i_type == REG_SZ )
{ {
strcat( p_data, "\\vlc" ); strcat( p_data, "\\plugins" );
ppsz_argv[0] = p_data; ppsz_argv[ppsz_argc++] = "--plugin-path";
ppsz_argv[ppsz_argc++] = p_data;
} }
} }
RegCloseKey( h_key ); RegCloseKey( h_key );
} }
#if 0 char p_path[MAX_PATH+1];
ppsz_argv[0] = "C:\\cygwin\\home\\damienf\\vlc-trunk\\vlc"; DWORD len = GetModuleFileNameA(DllGetModule(), p_path, sizeof(p_path));
#endif if( len > 0 )
{
p_path[len] = '\0';
ppsz_argv[0] = p_path;
}
// make sure plugin isn't affected with VLC single instance mode // make sure plugin isn't affected with VLC single instance mode
ppsz_argv[ppsz_argc++] = "--no-one-instance"; ppsz_argv[ppsz_argc++] = "--no-one-instance";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment