You are here

Locked DLL

9 posts / 0 new
Last post
computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 1 month ago
Developer
Joined: 2009-08-11 11:24
Locked DLL

I'm working on NVDA right now; it's pretty simple settings-wise (everything is self-contained), but it has a DLL's (IAccessible2Proxy.dll) that invariably gets locked by Explorer. Any ideas on breaking the lock?
I thought of doing a regsvr32 /u call, but I'm using PAL, which doesn't seem to support that kind of thing yet.

EDIT: this is worse than I thought. There are two DLL's that get locked, IAccessible2Proxy.dll and nvdaHelperRemote.dll, and they get tentacles all through the system. IAccessible2Proxy isn't too bad - it's just locked by Explorer - but nvdaHelperRemote gets tentacles into Firefox and igfxpers.exe (probably the graphics driver, IIRC), and I believe it gets into Thunderbird, Internet Explorer, etc. if they're open. regsvr32 doesn't do anything with either of these two, either, and even Process Explorer's "Close Handle" feature fails.
Requiring the user to reboot before they can remove their flash drive is completely unacceptable, but that's what I'm facing right now... help!

Thanks!

computerfreaker

dboki89
Offline
Last seen: 9 years 8 months ago
Joined: 2009-11-30 20:44
SpyDLLRemover Portable?

Have you tried removing a DLL with SpyDLLRemover Portable yet? If not, please try.

Note: a DLL doesn't have to be a "spy DLL" for the need for terminating it to exist, therefore I always use this simple utility.

Simply go to DLL Tracer tab, then enter the name of the DLL into the search box and go Search DLL. After that just click on the Remove All button, and that's it. It always works for me, I hope it does for you. Let me know if it did Biggrin

Cheers Smile

EDIT: I just noticed that it's a problem with making a new Portable program, and it is not acceptable for you to bundle the program with SpyDLLRemover just for the sake of removing 2 runaway DLL's... Sorry for that... I thought it was a problem with locked DLL for personal use, not in a program development. Sad
Serves me right. Next time, I'll look at the OP more carefully... I hope Blum Good luck

My posts are old and likely no longer relevant.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 3 months ago
Joined: 2007-04-15 21:08
<Field comment.title at 0x00000000>

DLL registration is something I need to look at next. With nvdaHelperRemote I don't know exactly what needs doing. The source code of the NVDA installer might help.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 1 month ago
Developer
Joined: 2009-08-11 11:24
Exception on Field comment.title: regsvr32 won't help

I already tried regsvr32 /u on those two stubborn DLL's; they won't budge, and the regsvr process errors out. I'm guessing a CloseHandle call is in order, but have no idea how to find the handle of the DLL to close it. I could probably do this in REALbasic, but API calls in NSIS are a whole separate ball of wax, and one I'd rather not get that deep into (even the BASIC code is ugly).

Any other suggestions? (I could perhaps modify NVDA itself; I'll look into it)

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 3 months ago
Joined: 2007-04-15 21:08
Look through its source code

That's about all I can suggest.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 1 month ago
Developer
Joined: 2009-08-11 11:24
Weird

This is weird: http://www.nvda-project.org/changeset/2945

Fixes to to NVDAHelper, which makes sure that IAccessible2Proxy is always unloaded when NVDA exits, as long as its not currently being used by an application to marshal IAccessible2 objects.

And yet, IAccessible2Proxy is still loaded up, and I checked to make sure it wasn't a one-time thing: I now have 2 different copies of IAccessible2Proxy and nvdaHelperRemote hooked into Explorer.

Going to use SpyDLL to get them out (thanks for the tip, dboki89!), but that's not acceptable for most/all users.

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 3 months ago
Joined: 2007-04-15 21:08
Background?

You're sure it's not still running anything in the background or something like that?

The CoFreeLibrary call they're using should do it. If something else has hooked into it, it must have registered itself somewhere in the registry. In the worst case, we write a script to go through all processes and close all handles to the offending file Biggrin

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

wraithdu
Offline
Last seen: 11 years 4 months ago
Developer
Joined: 2007-06-27 20:22
Simply invalidating the

Simply invalidating the handle to a loaded module (which is not that simple after all) is not a total solution. This would still leave the modules loaded in processes throughout the system, and could be bad for OS stability depending what that loaded DLL tries to do.

To be thorough you'd have to find each process where the DLL is loaded and remotely FreeLibrary. I've done this in AutoIt, but not NSIS. Still, it's an ugly hack of a solution.

This sounds like a problem that should really be fixed in the app source.

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 1 month ago
Developer
Joined: 2009-08-11 11:24
Can't be fixed

This can't be fixed, unfortunately. Chris Morgan, myself, and the NVDA devs had a long, long talk about it; trying to free the DLL's crashes Firefox and potentially Explorer. It can't be fixed in the launcher, in the app source, or anywhere else; at least, that was the general consensus.
More information here.

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Log in or register to post comments