diff options
Diffstat (limited to 'src/native/windows')
-rw-r--r-- | src/native/windows/msofficecomm/OutOfProcessServer.cxx | 149 | ||||
-rw-r--r-- | src/native/windows/msofficecomm/msofficecomm.vcxproj | 2 | ||||
-rw-r--r-- | src/native/windows/run/run.c | 1 |
3 files changed, 69 insertions, 83 deletions
diff --git a/src/native/windows/msofficecomm/OutOfProcessServer.cxx b/src/native/windows/msofficecomm/OutOfProcessServer.cxx index 5311471..416ba76 100644 --- a/src/native/windows/msofficecomm/OutOfProcessServer.cxx +++ b/src/native/windows/msofficecomm/OutOfProcessServer.cxx @@ -244,6 +244,11 @@ HRESULT OutOfProcessServer::loadRegTypeLib() LPTYPELIB iTypeLib; HRESULT hr = ::LoadRegTypeLib(LIBID_CommunicatorUA, 1, 0, 0, &iTypeLib); + Log::d( + _T("OutOfProcessServer::loadRegTypeLib:") + _T(" LoadRegTypeLib=%08X;") + _T("\n"), + hr); if (SUCCEEDED(hr)) _iTypeLib = iTypeLib; else @@ -261,50 +266,41 @@ HRESULT OutOfProcessServer::loadRegTypeLib() WCHAR path[MAX_PATH + 1]; DWORD pathCapacity = sizeof(path) / sizeof(WCHAR); DWORD pathLength = ::GetModuleFileNameW(module, path, pathCapacity); - if (pathLength && (pathLength < pathCapacity)) { hr = ::LoadTypeLibEx(path, REGKIND_NONE, &iTypeLib); + Log::d( + _T("OutOfProcessServer::loadRegTypeLib:") + _T(" LoadTypeLibEx(%s)=%08X;") + _T("\n"), + path, + hr); if (SUCCEEDED(hr)) { - HMODULE oleaut32 = ::GetModuleHandle(_T("oleaut32.dll")); - - if (oleaut32) + hr = ::RegisterTypeLibForUser(iTypeLib, path, NULL); + Log::d( + _T("OutOfProcessServer::loadRegTypeLib:") + _T(" RegisterTypeLibForUser=%08X;") + _T("\n"), + hr); + if (SUCCEEDED(hr)) { - typedef HRESULT (WINAPI *RTLFU)(LPTYPELIB,LPOLESTR,LPOLESTR); - RTLFU registerTypeLibForUser - = (RTLFU) - ::GetProcAddress( - oleaut32, - "RegisterTypeLibForUser"); - - if (registerTypeLibForUser) - { - hr = registerTypeLibForUser(iTypeLib, path, NULL); - if (SUCCEEDED(hr)) - { - /* - * The whole point of what has been done till - * now is securing the success of future calls - * to LoadRegTypeLib. Make sure that is indeed - * the case. - */ - - iTypeLib->Release(); - - hr - = ::LoadRegTypeLib( - LIBID_CommunicatorUA, - 1, - 0, - 0, - &iTypeLib); - if (SUCCEEDED(hr)) - _iTypeLib = iTypeLib; - } - } - else - hr = E_UNEXPECTED; + /* + * The whole point of what has been done till + * now is securing the success of future calls + * to LoadRegTypeLib. Make sure that is indeed + * the case. + */ + iTypeLib->Release(); + hr = ::LoadRegTypeLib( + LIBID_CommunicatorUA, 1, 0, 0, &iTypeLib); + Log::d( + _T("OutOfProcessServer::loadRegTypeLib:") + _T(" LoadRegTypeLib=%08X;") + _T("\n"), + hr); + if (SUCCEEDED(hr)) + _iTypeLib = iTypeLib; } else hr = E_UNEXPECTED; @@ -429,12 +425,28 @@ unsigned __stdcall OutOfProcessServer::run(void *) HRESULT hr = ::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); unsigned ret = 0; + Log::d( + _T("OutOfProcessServer::run:") + _T(" CoInitializeEx=%08X;") + _T("\n"), + hr); if (SUCCEEDED(hr)) { hr = loadRegTypeLib(); + Log::d( + _T("OutOfProcessServer::run:") + _T(" loadRegTypeLib=%08X;") + _T("\n"), + hr); if (SUCCEEDED(hr)) { - if (ERROR_SUCCESS == setIMProvidersCommunicatorUpAndRunning(1)) + hr = setIMProvidersCommunicatorUpAndRunning(1); + Log::d( + _T("OutOfProcessServer::run:") + _T(" setIMProvidersCommunicatorUpAndRunning(1)=%08X;") + _T("\n"), + hr); + if (ERROR_SUCCESS == hr) { MSG msg; @@ -446,10 +458,20 @@ unsigned __stdcall OutOfProcessServer::run(void *) ::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE); hr = registerClassObjects(); + Log::d( + _T("OutOfProcessServer::run:") + _T(" registerClassObjects=%08X;") + _T("\n"), + hr); if (SUCCEEDED(hr)) { - if (ERROR_SUCCESS - == setIMProvidersCommunicatorUpAndRunning(2)) + hr = setIMProvidersCommunicatorUpAndRunning(2); + Log::d( + _T("OutOfProcessServer::run:") + _T(" setIMProvidersCommunicatorUpAndRunning(2)=%08X;") + _T("\n"), + hr); + if (ERROR_SUCCESS == hr) { HANDLE threadHandle = _threadHandle; BOOL logMsgWaitForMultipleObjectsExFailed = TRUE; @@ -526,51 +548,12 @@ unsigned __stdcall OutOfProcessServer::run(void *) DWORD OutOfProcessServer::setIMProvidersCommunicatorUpAndRunning(DWORD dw) { - DWORD lastError; - - if (dw) - { - /* - * Testing on various machines/setups has shown that the following may - * or may not succeed without affecting the presence integration so just - * try them and then go on with the rest regardless of their success. - */ - lastError = ERROR_SUCCESS; - regCreateKeyAndSetValue( - _T("Software\\Microsoft\\Office\\11.0\\Common\\PersonaMenu"), - _T("RTCApplication"), - 3); - regCreateKeyAndSetValue( - _T("Software\\Microsoft\\Office\\12.0\\Common\\PersonaMenu"), - _T("RTCApplication"), - 3); - regCreateKeyAndSetValue( - _T("Software\\Microsoft\\Office\\11.0\\Common\\PersonaMenu"), - _T("QueryServiceForStatus"), - 2); - regCreateKeyAndSetValue( - _T("Software\\Microsoft\\Office\\12.0\\Common\\PersonaMenu"), - _T("QueryServiceForStatus"), - 2); - regCreateKeyAndSetValue( - _T("Software\\Microsoft\\Office\\11.0\\Outlook\\IM"), - _T("SetOnlineStatusLevel"), - 3); - regCreateKeyAndSetValue( - _T("Software\\Microsoft\\Office\\12.0\\Outlook\\IM"), - _T("SetOnlineStatusLevel"), - 3); - } - else - lastError = ERROR_SUCCESS; - if (ERROR_SUCCESS == lastError) - { - lastError + DWORD lastError = regCreateKeyAndSetValue( - _T("Software\\IM Providers\\Communicator"), + _T("Software\\IM Providers\\Jitsi"), _T("UpAndRunning"), dw); - } + return lastError; } diff --git a/src/native/windows/msofficecomm/msofficecomm.vcxproj b/src/native/windows/msofficecomm/msofficecomm.vcxproj index 96391df..b74f1d9 100644 --- a/src/native/windows/msofficecomm/msofficecomm.vcxproj +++ b/src/native/windows/msofficecomm/msofficecomm.vcxproj @@ -74,11 +74,13 @@ <LinkIncremental>true</LinkIncremental> <IncludePath>C:\Program Files (x86)\Microsoft Office Communicator\SDK;C:\Java\jdk8\include;C:\Java\jdk8\include\win32;$(IncludePath)</IncludePath> <TargetName>j$(ProjectName)</TargetName> + <OutDir>..\..\..\..\lib\native\windows\</OutDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <LinkIncremental>true</LinkIncremental> <TargetName>j$(ProjectName)</TargetName> <IncludePath>C:\Program Files %28x86%29\Microsoft Office Communicator\SDK;C:\Java\JDK8x64\include;C:\Java\JDK8x64\include\win32;$(IncludePath)</IncludePath> + <OutDir>..\..\..\..\lib\native\windows-64\</OutDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <LinkIncremental>false</LinkIncremental> diff --git a/src/native/windows/run/run.c b/src/native/windows/run/run.c index 7f152e9..4bae363 100644 --- a/src/native/windows/run/run.c +++ b/src/native/windows/run/run.c @@ -525,6 +525,7 @@ Run_getJavaVMOptionStrings = {
_T("lib\\felix.jar"),
_T("sc-bundles\\sc-launcher.jar"),
+ _T("sc-bundles\\dnsjava.jar"),
_T("sc-bundles\\util.jar"),
_T("lib"),
NULL
|