Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 05-24-2005, 04:35 AM
marno marno is offline
Junior Member
 
Join Date: May 2005
Posts: 2
Default LoadLibrary and Windows Server 2003 SP1

Hi!

I have a serious problem with loading a delphi dll on Windows Server 2003 SP1. The loading goes like this:

Host application (EXE of some sort) -> COM dll (server, built in Delphi) -> one or more delphi dlls.

The code run in the loading routine for the delphi dll is:
Code:
    HInst := LoadLibrary(Pointer(APath + 'somesubcomponent.dll'));
I have also tried SafeLoadLibrary, but the result is the same.

The EXE loads the COM dll just fine, but when the COM dll tries to load the delphi dlls the call is stopped and the COM and Host applications crash. Usin RegMon it seems like the dll loading routine in windows tries to find some information about the delphi dll before loading it. Among others it tries to look up "HKLM\Software\Borland\Locales" (and my dlls is not localized in any way, and the entries does not exist on our production machines) and some new registry entry "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\dllnxoptions". After doing this, the dll loading routine exits and the program crashes to windows, without regaining control (all is within an try/except but no exceptions are thrown or logged).

This is only a problem on Windows 2003 server with SP1 installed, we've tried the same computer with both SP1 and without, and it works if we uninstall SP1. It is also not always a problem on SP1 machines, but we've registered about 6-7 incidents of the same problem until now.

I hope you are able to help! thanks in advance

Yours sincerely
Markus Nordstrønen
Reply With Quote
  #2  
Old 05-24-2005, 04:52 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 6,827
Default RE: LoadLibrary and Windows Server 2003 SP1

Hi ...

Why pointer, use PChar instead ???
Code:
HInst := LoadLibrary(PChar(APath + 'somesubcomponent.dll'));
MvG
Peter

Objective reality is a delirium caused by lack of alcohol in blood.
24 hous in a day, 24 beers in a case. Coincidence ???
There are 10 kinds of people: Those who understand binary and those who don't
Reply With Quote
  #3  
Old 05-24-2005, 10:17 PM
marno marno is offline
Junior Member
 
Join Date: May 2005
Posts: 2
Default RE: LoadLibrary and Windows Server 2003 SP1

Ah, well, I did use PChar, not Pointer, just a small typo when rewriting the code.

Anyone have experienced anything like this?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 11:57 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.