diff options
author | Tor Lillqvist <tlillqvist@suse.com> | 2011-09-19 12:29:40 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2011-09-19 12:29:52 +0100 |
commit | 299ada910665c38cc9ccd7a20fb54f8b15229f8c (patch) | |
tree | b6267c5261eb852d301a3904ad0874e2b0e23ba3 | |
parent | 253ff23c3a93b5ea45a2451a8bc97fca19856a75 (diff) |
Improve windows odma library location
Signed-off-by: Michael Meeks <michael.meeks@novell.com>
-rw-r--r-- | ucb/source/ucp/odma/odma_lib.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ucb/source/ucp/odma/odma_lib.cxx b/ucb/source/ucp/odma/odma_lib.cxx index 074c58587a..f998358e34 100644 --- a/ucb/source/ucp/odma/odma_lib.cxx +++ b/ucb/source/ucp/odma/odma_lib.cxx @@ -80,16 +80,25 @@ namespace odma if (bBeenHere) return bLoaded; + bBeenHere = sal_True; + ::rtl::OUString sPath; #ifdef WNT - sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA32.DLL")); + OSL_ASSERT( sizeof( wchar_t ) == sizeof( sal_Unicode ) ); + + wchar_t system32[MAX_PATH]; + UINT n = GetSystemDirectoryW( system32, MAX_PATH ); + + if (n == 0) + return sal_False; + + sPath = ::rtl::OUString( reinterpret_cast< const sal_Unicode* >( system32 ), n ) + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\\ODMA32.DLL")); + #endif #ifdef UNX sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("libodma.so")); #endif - bBeenHere = sal_True; - pODMA = osl_loadModule( sPath.pData,SAL_LOADMODULE_NOW ); if( !pODMA) return sal_False; |