Article View: borland.public.cppbuilder.nativeapi
Article #7643Re: global system hook
From: nicolasr
Date: Thu, 30 Dec 2004 01:35
Date: Thu, 30 Dec 2004 01:35
40 lines
2488 bytes
2488 bytes
thanks for the quick reply. >> 1) My dll currently has the most imaginative >> file name 'hook.dll'. Will I get into trouble when >> other programs are using the same dll name for >> their global hook? Or is a unique directory path >> sufficient? > > That depends on 1) where you are placing your DLL, 2) how you are loading > your DLL (using absolute or relative paths), and 3) how the other programs > are loading their DLLs. The exe that installs the hook uses the absolute path although the DLL is in the same directory (exePath + "\hook.dll"). So I hope this is safe then. >> 3) After some tests I needed to change and rebuild >> my hook dll. However, BCB doesn't link it because of >> [Linker Fatal Error] Fatal: Could not open D:\...\Hook.dll (program >> still running?) Using a process explorer I found that two processes >> still have the dll mapped, iexplorer.exe and dexplorer.exe >> How can this be after my test program deinstalled the hook? > > You can uninstall the hook, but you cannot tell the other processes that > have the DLL injected into them to release their references to the DLL. > You > can only do that with your own process. MSDN says as much: [snip] thanks for the link! I found that the referencing IE instance was hanging. That probably was the reason why all other apps did not reference the DLL anymore but IE did. After all this seems to be an issue while developing. At runtime it shouldn't matter who still holds references to the DLL as long as the hook is uninstalled. Nick
Technical Details
Message-ID:
<41d35b93$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41d33187@newsgroups.borland.com> <41d33e45@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8f50842da09c0f93 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "nicolasr" <nicolasrNOSPAMATSIGNgmx.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <41d33187@newsgroups.borland.com> <41d33e45@newsgroups.borland.com> Subject: Re: global system hook Date: Thu, 30 Dec 2004 02:35:30 +0100 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 80.133.189.1 Message-ID: <41d35b93$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1104370579 80.133.189.1 (29 Dec 2004 17:36:19 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail