Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

BindImage custom DLL's, LoadLibrary fail w 998


1 reply to this topic

brunzefb

brunzefb
  • Members
  • 1 posts

Posted 11 December 2003 - 23:30

Hi,
I have run across a weird problem with an MSI installer that is very hard to track down, so I wanted to share the experiences somewhere. Scenario is this:

1. Installer Installs Files
2. Installer Registers Files.
3. IScript makes a call to a custom DLL (USEDLL), (UnUseDLL)
4. Installer Binds all installed files, including custom DLL
5. IScript makes a further call to Custom DLL (USEDLL)
Inside Custom DLL, a call is being made to LoadLibrary (DLL2)
Inside LoadLibrary(DLL2), a dependent DLL3 is pulled in.
OS tries to run some init code to initialize DLL3, but encounters an access violation
LoadLibrary fails (return NULL), error code GetLastError() =998
Custom call fails.

This happens only in the RELEASE mode, not in Debug, and only with VC .NET2003 on XP SP1

Disabling the Bind Step resolves the problem completely.
Here's what I suspect is happening - since the BindImage changes the DLL, portions of the DLL may still live in the paging file. Since the timestamp is not altered by BindImage, the page file and the disk and memory no longer agree, hence weird failure when initializing the DLL.

If anyone knows about this problem or about the exact cause, pls give me short email.

Friedrich


Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 12 December 2003 - 09:05

This sounds weird... Could you install the dll to SUPPORTDIR and do the call you need to do on that copy of the file, and then install the file you bind to INSTALLDIR?
Regards
-Stein Åsmul