New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using GetModuleFileName in get_process_name() with NULL module handle [CORE2345] #2769
Comments
Modified by: Zoltán Török (torokze)description: The Firebird::PathName get_process_name() on Windows platform could lead into the following situation: You have a plugin based software. The plugins placed into a directory below the main executable. c:\program files\software - where the main executable resides If one of the plugins uses the Firebird embeded version the client library (fbembed as fbclient.dll) placed into the plugin directory (c:\program files\software\plugins) Example: c:\program files\software\plugins - where the plugin modules (dll-s) resides The GetModuleFileName(NULL, ....) returns c:\program files\software\main.exe not the c:\program files\software\plugins\fbclient.dll => The Firebird::PathName get_process_name() (in src\common\utils.cpp) on Windows platform could lead into the following situation: You have a plugin based software. The plugins placed into a directory below the main executable. c:\program files\software - where the main executable resides If one of the plugins uses the Firebird embeded version the client library (fbembed as fbclient.dll) placed into the plugin directory (c:\program files\software\plugins) Example: c:\program files\software\plugins - where the plugin modules (dll-s) resides The GetModuleFileName(NULL, ....) returns c:\program files\software\main.exe not the c:\program files\software\plugins\fbclient.dll |
Modified by: Zoltán Török (torokze)description: The Firebird::PathName get_process_name() (in src\common\utils.cpp) on Windows platform could lead into the following situation: You have a plugin based software. The plugins placed into a directory below the main executable. c:\program files\software - where the main executable resides If one of the plugins uses the Firebird embeded version the client library (fbembed as fbclient.dll) placed into the plugin directory (c:\program files\software\plugins) Example: c:\program files\software\plugins - where the plugin modules (dll-s) resides The GetModuleFileName(NULL, ....) returns c:\program files\software\main.exe not the c:\program files\software\plugins\fbclient.dll => The Firebird::PathName get_process_name() (in src\common\utils.cpp) on Windows platform could lead into the following situation: You have a plugin based software. The plugins placed into a directory below the main executable. c:\program files\software - where the main executable resides If one of the plugins uses the Firebird embeded version the client library (fbembed as fbclient.dll) placed into the plugin directory (c:\program files\software\plugins) Example: c:\program files\software\plugins - where the plugin modules (dll-s) resides The GetModuleFileName(NULL, ....) returns c:\program files\software\main.exe not the c:\program files\software\plugins\myplugin.dll |
Modified by: @asfernandes |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Duplicate [ 3 ] assignee: Adriano dos Santos Fernandes [ asfernandes ] |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovQA Status: No test |
Submitted by: Zoltán Török (torokze)
Duplicates CORE1814
The Firebird::PathName get_process_name() (in src\common\utils.cpp) on Windows platform could lead into the following situation:
You have a plugin based software. The plugins placed into a directory below the main executable.
Just like this:
c:\program files\software - where the main executable resides
c:\program files\software\plugins - where the plugin modules (dll-s) resides
If one of the plugins uses the Firebird embeded version the client library (fbembed as fbclient.dll) placed into the plugin directory (c:\program files\software\plugins)
After the plugin loads the client library the GetModuleFileName(NULL, ....) gets back the main executable path. This is wrong because the fb located in the plugins directory.
The embeded fb client looks for all the necessary files (aliases.conf, firebird.conf, firebird.msg, UDF dir) in the main executable dir not where the actual client library resides.
Example:
c:\program files\software\main.exe - where the main executable resides
c:\program files\software\plugins - where the plugin modules (dll-s) resides
c:\program files\software\plugins\myplugin.dll (depends on firebird)
c:\program files\software\plugins\fbclient.dll
c:\program files\software\plugins\firebird.conf
c:\program files\software\plugins\firebird.msg
c:\program files\software\plugins\aliases.conf
...
c:\program files\software\plugins\udf
The GetModuleFileName(NULL, ....) returns c:\program files\software\main.exe not the c:\program files\software\plugins\myplugin.dll
The text was updated successfully, but these errors were encountered: