Autor Beitrag
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Mo 27.09.04 14:56 
Hi!

Ich würde gerne herausbekommen, wo im System nach DLLs gesucht wird, wenn ein neuer Prozess gestartet wird, oder wenn eine DLL zur Laufzeit in einem Prozess geladen wird (sofern keine Pfadangabe bei der DLL dabei ist, wenn man sie lädt). Ich würde diese Info irgendwo in der Registry vermuten, ich weiß nur nicht genau wo :( Vielleicht weiß es ja jemand von euch :) Ich hab schon die API-Funktion GetDllDirectory ausfindig gemacht, die gibt es aber leider erst seit WinXP SP 1 und das reicht mir leider net...


Danke!



MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
Alstar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Mo 27.09.04 14:57 
Also rein ins Balue geraten, würde ich mal sagen: In den Verzeichnissen, die in der PATH-Variablen stehen.

Auf jeden Fall aber im Windows- und im System-Verzeichnis.

Alstar
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 27.09.04 15:09 
Und meines Wissens noch im Startverzeichnis der Anwendung.
Bei der PATH-Variablen bin ich mir nicht so sicher.
MrSaint Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Mo 27.09.04 15:17 
hmmm... Also PATH glaub ich eher net.. Das mit dem Windows- und Systemverzeichnis klingt sehr logisch und das mit dem Startverzecihnis der EXE auch. aber is das wirklich nur das? irgendwie klingt mir das n bissl "statisch" weil man so ja keine anderen ordner hinzufügen könnte, in denen auch noch gesucht werden soll... wie siehts mit den unterordnern der verzeichnisse aus?


Weiß das jemand mit sicherheit wie das aussieht? nich, dass nacher meine anwendung hier bei mir super läuft, aber bei anderen leuten eben net... das wär bissl blöd ;)




MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Mo 27.09.04 15:39 
Warum muss man da eigentlich ins Blaue raten? ;-)

PSDK hat folgendes geschrieben:
If no file name extension is specified in the lpFileName parameter, the default library extension .dll is appended. However, the file name string can include a trailing point character (.) to indicate that the module name has no extension. When no path is specified, the function searches for loaded modules whose base name matches the base name of the module to be loaded. If the name matches, the load succeeds. Otherwise, the function searches for the file in the following sequence:

  1. The directory from which the application loaded.
  2. The current directory.
  3. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  4. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
    Windows Me/98/95: This directory does not exist.
  5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  6. The directories that are listed in the PATH environment variable.


Windows Server 2003, Windows XP SP1: The default value of HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode is 1 (current directory is searched after the system and Windows directories).

Windows XP: If HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode is 1, the current directory is searched after the system and Windows directories, but before the directories in the PATH environment variable. The default value is 0 (current directory is searched before the system and Windows directories).

The first directory searched is the one directory containing the image file used to create the calling process (for more information, see the CreateProcess function). Doing this allows private dynamic-link library (DLL) files associated with a process to be found without adding the process's installed directory to the PATH environment variable.

The search path can be altered using the SetDllDirectory function. This solution is recommended instead of using SetCurrentDirectory or hard-coding the full path to the DLL.

Quelle: Suche im MSDN IRGENDWO IN DEN SUCHRESULTATEN WIRD'S SCHON SEIN


Edit: Visual Enhancements, nachdem ich gemerkt habe, daß Copy&Paste von Listen nicht das sinnvollste ist, was man machen kann...

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
MrSaint Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Mo 27.09.04 15:55 
aaahhh, sehr geil, danke :) da hätte man auch selber drauf kommen können, da bei LoadLibrary zu suchen :oops:



MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
MrSaint Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Di 28.09.04 15:06 
hi!


So, nun nochmal ne frage. Was bitte soll denn das heißen:
Zitat:
4. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.


Das einzige was ich mir vorstellen könnte, das dass dann eben z.B. C:\Windows\System (ohne 32) sein wird. Aber weiß jemand wie ich das "dynamisch" herausbekommen kann? ich kann das ja so nich hardcoden. Das einzige was mir einfallen würde wäre %SystemRoot%\System, aber is das immer da? und is das überhaupt das 16-bit system directory?

Irgendwie stell ich mich glaub grad bissl kompliziert an :oops:



MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems