Commit Graph

20 Commits

Author SHA1 Message Date
nickysn
c9b3279e3c + added unit dynlibs to the win16 rtl
git-svn-id: trunk@31901 -
2015-10-01 13:10:40 +00:00
svenbarth
2d454dc8fa Move DynLibs support to System unit using a manager approach like for Threads, WideStrings, etc.. This is needed so that we can support features like "delayed" and loading of dynamic packages.
Each port that allows the usage of dynamic libraries should call InitSystemDynLibs during initialization of the System unit.
The DynLibs unit has been adjusted to be a forwarder for the functions that now reside in the System unit (for backwards compatiblity just in case). Additionally the unit will register the DynLibsManager if it doesn't reside in the System unit anyway.
Currently only the Windows targets (Win32, Win64 and WinCE) implement the DynLibsManager inside the System unit. For other systems using the LoadLibrary, etc. functions will lead to a run error/exception.
If a port wants to implement its own DynLibsManager then it needs to define DISABLE_NO_DYNLIBS_MANAGER. TLibHandle, NilHandle and optionally TOrdinalEntry (it's set to SizeUInt otherwise) should be defined in sysdlh.inc which needs to be enabled using the define FPC_SYSTEM_HAS_SYSDLH (because there are targets which have FEATURE_DYNLIBS enabled, but don't support them... e.g. powerpc-wii -.-).
The DynLibsManager contains methods for loading a library based on a RawByteString and based on a UnicodeString. BOTH should be implemented, but internally one can forward to the other.
The loading by ordinal *can* be be implemented. If it is set to Nil then the implementation of GetProcAddress(lib,ordinal) will return Nil.

+ new functions SetDynLibsManager and GetDynLibsManager to set and retrieve the current DynLibsManager
* provide interface of DynLibs unit in unit System

git-svn-id: trunk@29613 -
2015-02-03 20:00:00 +00:00
sergei
b16c6f8ced * i386 and x86_64 changes for Delphi compatibility:
* 'mxcsr' variable made public and renamed to DefaultMXCSR.
  * GetSSECSR and SetSSECSR renamed to GetMXCSR and SetMXCSR, respectively. Previous names continue to exist as deprecated aliases.

git-svn-id: trunk@27656 -
2014-04-25 15:10:12 +00:00
Tomas Hajny
1a430d8110 * GetProcAddr added for OS/2, type of argument for ordinal target specific now
git-svn-id: trunk@26521 -
2014-01-19 21:15:26 +00:00
svenbarth
6273192ce1 + Add a new overload to DynLibs to allow loading by Ordinal only. This needs specific operating system support however and will return Nil (using a default implementation) if ordinals are not supported.
+ Implement overload for the three supported Windows targets.

git-svn-id: trunk@26457 -
2014-01-14 15:23:55 +00:00
Jonas Maebe
3fdb3092af + defaultfilesystemcodepage support for dynlibs
+ unicodestring overloads for (safe)loadlibrary()

git-svn-id: branches/cpstrrtl@25162 -
2013-07-22 21:45:34 +00:00
michael
8eeb22720b * Added GetLoadErrorStr function by Mark Morgan Loyd (Bug ID 22321)
git-svn-id: trunk@21880 -
2012-07-11 15:31:09 +00:00
florian
859757003f * fix SafeLoadLibrary: fixed defines, sse control word should be stored as well
git-svn-id: trunk@18255 -
2011-08-18 08:37:15 +00:00
marco
88e22be01a * unmerged table based initialization of libraries.
git-svn-id: trunk@16941 -
2011-02-19 17:24:37 +00:00
sergei
cbdc08b641 * dynlibs.pas: added 'const' modifiers to eliminate unnecessary local string copies
git-svn-id: trunk@16366 -
2010-11-18 22:09:48 +00:00
ivost
4e39959ca1 * InitializeLibrary defaults now the parameter NoSymbolErrors to true and no longer to false. Now it's the same behavior as in 2.4.0 release. But of course it's not optimal and not safe.
* LoadLibrarySymbols report now all symbol errors and not just the first one. Eg. it try to load all symbols and don't stop on first error now.

git-svn-id: trunk@16269 -
2010-10-30 20:49:12 +00:00
ivost
8a25a5fbc7 * removed writeln call
* added some more comments

git-svn-id: trunk@15296 -
2010-05-19 11:26:09 +00:00
ivost
5604937bd4 * fixed #0016261
git-svn-id: trunk@15262 -
2010-05-12 20:41:00 +00:00
Tomas Hajny
5c31042f6a * SharedSuffix moved to include files to reduce number of ifdefs
git-svn-id: trunk@14902 -
2010-02-13 15:44:12 +00:00
ivost
a9150ebb8a * lib handler: default libraries can be changed now
git-svn-id: trunk@13995 -
2009-11-01 11:28:17 +00:00
ivost
3e16584155 * symbols are cleared now after unloading the library (ClearLibrarySymbols)
git-svn-id: trunk@13979 -
2009-10-30 13:42:49 +00:00
ivost
bd25e02096 * added some highlevel helper functions to load/unload dynamic libraries.
* initialize/release calls are refcounted. On loading, requested symbols are checked.

git-svn-id: trunk@13975 -
2009-10-30 13:16:13 +00:00
marco
03c02a17e9 * SharedSuffix
git-svn-id: trunk@10825 -
2008-04-27 20:33:33 +00:00
marco
9c45584938 * Safeloadlibrary
git-svn-id: trunk@7985 -
2007-07-09 08:07:42 +00:00
michael
d49ffdf543 * Renamed dynlibs.pas
git-svn-id: trunk@6613 -
2007-02-23 11:06:37 +00:00