Kaydet (Commit) c2f9e24e authored tarafından Minh Ngo's avatar Minh Ngo

Avmedia/VLC: Correct reading from the WINx86_64 registry for LO 32-bit.

Change-Id: Ic98a179e5cfa34183e71a72bb417147612500a61
TODO: Unfortunately. Another cases must be checked later....
üst 5e465454
...@@ -47,21 +47,23 @@ namespace ...@@ -47,21 +47,23 @@ namespace
wchar_t arCurrent[MAX_PATH]; wchar_t arCurrent[MAX_PATH];
DWORD dwType, dwCurrentSize = sizeof( arCurrent ); DWORD dwType, dwCurrentSize = sizeof( arCurrent );
if ( ::RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"SOFTWARE\\VideoLAN\\VLC", //TODO: This one will work only with LibreOffice 32-bit + VLC 32-bit on Win x86_64.
0, KEY_READ, &hKey ) == ERROR_SUCCESS ) 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 && if ( ::RegQueryValueExW( hKey, L"InstallDir", NULL, &dwType, (LPBYTE) arCurrent, &dwCurrentSize ) == ERROR_SUCCESS &&
dwType == REG_SZ ) dwType == REG_SZ )
{ {
::RegCloseKey( hKey ); ::RegCloseKey( hKey );
// The value might be 0-terminated or not dwCurrentSize -= 2;
if (arCurrent[dwCurrentSize/2] == 0) dwCurrentSize /= 2;
dwCurrentSize -= 2;
return OUString( arCurrent, dwCurrentSize ) + "/"; return OUString( arCurrent, dwCurrentSize ) + OUString::createFromAscii("\\");
} }
::RegCloseKey( hKey ); ::RegCloseKey( hKey );
} }
return OUString(); return OUString();
} }
#endif #endif
...@@ -100,6 +102,7 @@ namespace ...@@ -100,6 +102,7 @@ namespace
oslModule aModule = osl_loadModule( fullPath.pData, oslModule aModule = osl_loadModule( fullPath.pData,
SAL_LOADMODULE_DEFAULT ); SAL_LOADMODULE_DEFAULT );
if( aModule == NULL) if( aModule == NULL)
{ {
SAL_WARN("avmedia", "Cannot load libvlc"); SAL_WARN("avmedia", "Cannot load libvlc");
......
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