Bug 43188 - small program that inject dll in LibreOffice Quickstarter in order to improve component start time.
Summary: small program that inject dll in LibreOffice Quickstarter in order to improve...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: contrib (show other bugs)
(earliest affected)
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
Depends on:
Reported: 2011-11-23 01:48 UTC by Maxime de Roucy
Modified: 2012-09-11 19:42 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:
Regression By:

Dev-C++ project folder (20.83 KB, application/zip)
2011-11-23 01:48 UTC, Maxime de Roucy
the exe with dll_loader_*.txt and licence file (26.36 KB, application/zip)
2011-11-25 02:48 UTC, Maxime de Roucy
source files (14.94 KB, application/zip)
2011-11-25 03:02 UTC, Maxime de Roucy
the exe with dll_loader_*.txt and licence file (89.09 KB, application/zip)
2011-11-30 04:55 UTC, Maxime de Roucy
new sources and dll list for LO 3.4.5 (13.76 KB, application/x-xz)
2012-03-13 10:07 UTC, Maxime de Roucy

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime de Roucy 2011-11-23 01:48:29 UTC
Created attachment 53796 [details]
Dev-C++ project folder


I created a small program that inject dlls in Quickstarter (it support LibreOffice and OpenOffice).

It look in the dll_loader_libreoffice.txt file (or dll_loader_openoffice.txt for openoffice) and inject the dlls it found in the Libreoffice soffice.bin process.

Currently the dlls in dll_loader_libreoffice.txt are those used by Writter and Calc.

For my part, I observed that the first launch start time of Writter and Calc are improved by approximately 50 %.

I put the code under GPLv3, feel free to tell me if that makes problem ; I am ready to change !

I attached the entire Dev-C++ project directory, the only important files are :
- main.cpp
- dll_loader_libreoffice.txt
- dll_loader_openoffice.txt

To use it just compile it and put a link to dll_loader.exe in your "Start" folder.
Comment 1 Maxime de Roucy 2011-11-25 02:48:26 UTC
Created attachment 53845 [details]
the exe with dll_loader_*.txt and licence file
Comment 2 Maxime de Roucy 2011-11-25 03:00:40 UTC
Some users seams to have problem with the GetModuleFileNameEx function.
I changed it to GetProcessImageFileName but Dev-C++ can't compile it anymore since it doesn't have this function in his psapi.h.

I attached a new folder with the main.cpp file ; both dll_loader_libreoffice.txt and dll_loader_openoffice.txt and licence file.

In order to compile it you need to add Psapi.lib and Shlwapi.lib to the linker.
Comment 3 Maxime de Roucy 2011-11-25 03:02:17 UTC
Created attachment 53846 [details]
source files
Comment 4 Maxime de Roucy 2011-11-30 04:55:16 UTC
Created attachment 53966 [details]
the exe with dll_loader_*.txt and licence file

I changed the zip file attached containing the exe cause I didn't know that programs built with visual studio needs the msvcp100.dll to work.

I built the new exe with static libs so the user doesn't need to have the dll installed anymore.
Comment 5 Maxime de Roucy 2011-11-30 05:11:32 UTC
For your information this program was developed on a request to Linagora from the "Communauté Urbaine de Bordeaux" (CUB).
Comment 6 Maxime de Roucy 2012-03-13 10:07:30 UTC
Created attachment 58383 [details]
new sources and dll list for LO 3.4.5

Here is the new sources that modify the name of the lists files. The LO dll list has been updated for LO 3.4.5.
Comment 7 Don't use this account, use tml@iki.fi 2012-03-13 12:12:00 UTC
Hmm, if it indeed is beneficial to load these DLLs right at start of soffice.bin, could you then instead provide a patch to that does that, in the LibreOffice code itself?
Comment 8 Maxime de Roucy 2012-03-14 02:20:38 UTC
Yes, I already thought about that… I planned to do it. But currently I don't have so much time to code for LO and I really prefer coding on other part than the Windows specific ones.

I already found some informations about explicit dll loading on the Microsoft web site :
Comment 9 Caolán McNamara 2012-09-11 19:42:45 UTC
we discussed this a bit on the list IIRC, As it stands its not integrateable into stock libreoffice, so someone with an interest and time would have to investigate a bit further