[PATCH] kdecore crashes LoadLibrary calls

Patrick Spendrin ps_ml at gmx.de
Wed Mar 25 10:23:21 CET 2009


Hi,

I have a small patch here which fixes a problem I recently got aware of:
if you try to make a regsvr32 kdecore.dll it will fail saying that
LoadLibrary was not achieved (simply try it). The correct error message
would have been a missing entrypoint for DllRegisterServer though.
After searching for quite a while I found the problem:
When you load kdecore linked to an executable, the image will be located
at the address 0x0040000. When you load kdecore directly via regsvr32,
the image will have the address 0x10000000 (0x1 0x0) instead.
When trying to read from the first one then you will obviously get a
"crash". As I am unable to find out where our image is (this is the
address of the HINSTANCE parameter in the DllMain) as the constructor of
the static class will be called before running the DllMain, I have now
changed it so that the code will be called from the DllMain with the
parameter.

As this patch might change the behaviour of your debug output, please
check if it works for you | comment it.

regards,
Patrick

-- 
web:                 http://windows.kde.org
mailing list:        kde-windows at kde.org
irc:                 #kde-windows (irc.freenode.net)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0151-kdecore-loadLibraryProof.diff
Type: text/x-patch
Size: 7624 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-windows/attachments/20090325/2d4ce1b4/attachment.diff 


More information about the Kde-windows mailing list