From c2f9e24ecfdc36decb9c3042d88976399e4606aa Mon Sep 17 00:00:00 2001 From: Minh Ngo Date: Mon, 7 Oct 2013 10:14:10 +0300 Subject: Avmedia/VLC: Correct reading from the WINx86_64 registry for LO 32-bit. Change-Id: Ic98a179e5cfa34183e71a72bb417147612500a61 TODO: Unfortunately. Another cases must be checked later.... --- avmedia/source/vlc/wrapper/SymbolLoader.hxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'avmedia') diff --git a/avmedia/source/vlc/wrapper/SymbolLoader.hxx b/avmedia/source/vlc/wrapper/SymbolLoader.hxx index ec38d1b94eb6..7061fafc956d 100644 --- a/avmedia/source/vlc/wrapper/SymbolLoader.hxx +++ b/avmedia/source/vlc/wrapper/SymbolLoader.hxx @@ -47,21 +47,23 @@ namespace wchar_t arCurrent[MAX_PATH]; DWORD dwType, dwCurrentSize = sizeof( arCurrent ); - if ( ::RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"SOFTWARE\\VideoLAN\\VLC", - 0, KEY_READ, &hKey ) == ERROR_SUCCESS ) + //TODO: This one will work only with LibreOffice 32-bit + VLC 32-bit on Win x86_64. + const LONG errorCore = ::RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"SOFTWARE\\Wow6432Node\\VideoLAN\\VLC", 0, KEY_READ | KEY_WOW64_64KEY, &hKey ); + if ( errorCore == ERROR_SUCCESS ) { if ( ::RegQueryValueExW( hKey, L"InstallDir", NULL, &dwType, (LPBYTE) arCurrent, &dwCurrentSize ) == ERROR_SUCCESS && dwType == REG_SZ ) { ::RegCloseKey( hKey ); - // The value might be 0-terminated or not - if (arCurrent[dwCurrentSize/2] == 0) - dwCurrentSize -= 2; - return OUString( arCurrent, dwCurrentSize ) + "/"; + dwCurrentSize -= 2; + dwCurrentSize /= 2; + + return OUString( arCurrent, dwCurrentSize ) + OUString::createFromAscii("\\"); } ::RegCloseKey( hKey ); } + return OUString(); } #endif @@ -100,6 +102,7 @@ namespace oslModule aModule = osl_loadModule( fullPath.pData, SAL_LOADMODULE_DEFAULT ); + if( aModule == NULL) { SAL_WARN("avmedia", "Cannot load libvlc"); -- cgit