Commit Graph

12 Commits

Author SHA1 Message Date
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
Tomas Hajny
2c60f456f1 * fixed WinCE breakage caused when moving to target dependent type for ordinal argument in GetProcAddress
git-svn-id: trunk@26522 -
2014-01-19 22:42:52 +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
252c2bbc83 * FormatMessageA -> FormatMessage (W version)
git-svn-id: trunk@21937 -
2012-07-18 09:17:30 +00:00
michael
8a9bd38cd7 * Copied non-sysutils solution of win32/64
git-svn-id: trunk@21936 -
2012-07-18 07:38:21 +00:00
michael
78bfc145c1 * No SysErrorMessage on WinCE ?
git-svn-id: trunk@21935 -
2012-07-18 07:36:24 +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
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
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
peter
627cf69ae3 * svn props
git-svn-id: trunk@8468 -
2007-09-14 07:19:48 +00:00
yury
771743a61c * varutils,variants,dynlibs units are built now for wince.
* added readme.txt

git-svn-id: trunk@1316 -
2005-10-07 16:45:48 +00:00