diff options
author | Minh Ngo <nlminhtl@gmail.com> | 2013-10-07 10:14:10 +0300 |
---|---|---|
committer | Minh Ngo <nlminhtl@gmail.com> | 2013-10-07 10:26:40 +0300 |
commit | c2f9e24ecfdc36decb9c3042d88976399e4606aa (patch) | |
tree | 28e4cce4a75b3f8db0c9571b3362107182cec636 | |
parent | 5e46545458ae42086d3886b82eddb99c2d72c63a (diff) |
Avmedia/VLC: Correct reading from the WINx86_64 registry for LO 32-bit.
Change-Id: Ic98a179e5cfa34183e71a72bb417147612500a61
TODO: Unfortunately. Another cases must be checked later....
-rw-r--r-- | avmedia/source/vlc/wrapper/SymbolLoader.hxx | 15 |
1 files changed, 9 insertions, 6 deletions
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"); |