Commit Graph

540 Commits

Author SHA1 Message Date
Tomas Hajny
92d045c483 * GetStdHandle returns a THandle (use of longint was not 64-bit safe)
git-svn-id: trunk@33460 -
2016-04-10 01:26:30 +00:00
michael
ad34300873 * Patch from Denis Kozlov to fix buffer errors (bug ID 29942)
git-svn-id: trunk@33406 -
2016-04-02 09:13:56 +00:00
michael
e3aaeae2e7 * Fix bug ID #29913
git-svn-id: trunk@33363 -
2016-03-28 13:16:31 +00:00
michael
65c880a7f6 * Use STACK_SIZE_PARAM_IS_A_RESERVATION for stack sizes, should fix bug ID #17755
git-svn-id: trunk@33346 -
2016-03-27 11:12:47 +00:00
michael
12d7061212 * Define STACK_SIZE_PARAM_IS_A_RESERVATION
git-svn-id: trunk@33345 -
2016-03-27 11:11:54 +00:00
marco
66608fec02 * unicode executeprocess from work during Lazarus convention in IJsselstein
git-svn-id: trunk@33290 -
2016-03-19 17:59:42 +00:00
marco
3ca2c1553d * copyfileexw (mantis #29729)
git-svn-id: trunk@33227 -
2016-03-12 22:30:23 +00:00
marco
0bfdfe20ea * second batch of mantis #29762 related -w function fixes..
git-svn-id: trunk@33217 -
2016-03-11 15:52:08 +00:00
marco
5e8bc3a631 * mantis #29762 unicode structure problems fixed up to and including MessageBoxIndirectW
git-svn-id: trunk@33216 -
2016-03-11 12:07:36 +00:00
michael
c0487d7ef9 * Fix bug ID #29784
git-svn-id: trunk@33154 -
2016-03-05 15:00:40 +00:00
marco
1ae1e9310b * defined -A and -W structs and callback for a couple of functions Mantis #0029762
git-svn-id: trunk@33143 -
2016-03-02 13:46:37 +00:00
svenbarth
af53fcb48c Adjust SysInstance so that it is correctly handled with the indirect entry information on Win32
win/sysosh.inc, TEntryInformationOS:
  + new field SysInstance that will hold the address to the main program's SysInstance variable
win32/system.pp:
  * rename SysInstance to FPCSysInstance and make it a PLongInt
  * OsSetupEntryInformation: setup FPCSysInstance
  * adjust initialization of SysInstance to use FPCSysInstance instead
win32/sysinit.inc:
  * SysInstance is no longer an external
  * initialize the OS.SysInstance field of EntryInformation
win64/system.pp:
  * add a FPCSysInstance that's a pointer to SysInstance
win/winres.inc:
  * SysInstance is now a pointer and has the same name on both Win32 and Win64

git-svn-id: trunk@33107 -
2016-02-19 16:22:20 +00:00
svenbarth
6afda909d4 Rework TlsKey handling on Windows so that it works as intended with indirect main information
rtl/inc/system.inc:
  * SetupEntryInformation: call new, optional function OSSetupEntryInformation to handle platform specific entry information initialization
rtl/win/sysosh.inc, TEntryInformationOS:
  + new field TlsKeyAddr which will hold the address to the main binary's TlsKey variable
win32/sysinit.inc:
  + provide the variable holding the TlsKey and pass that on to the entry information record
win32/system.pp:
  + new OS specific entry information initialization (currently only the TlsKey)
win/systhrd.inc:
  * declare TlsKey as a pointer to a DWord value instead of a DWord; on non-indirect entry platforms this is initialized with the address of new variable TlsKeyVar, on indirect entry platforms it will be initialized by the entry information initialization
  * adjust usages of TlsKey from DWord to PDWord
win/systlsdir.inc:
  * TlsKey is now a PDWord and (in sysinit) points to TlsKeyVar
win/syswin.inc:
  * adjust TlsKey usage
inc/heaptrc.pp:
  * TlsKey is now a PDWord, thus adjust the import and the usage

git-svn-id: trunk@33091 -
2016-02-12 17:03:52 +00:00
svenbarth
1951b8aaaa Fix threadvar handling. Basically a merge of r31913 of my packages branch.
rtl/inc/system.inc:
  * provide a public alias for SetupEntryInformation so that it can be used in SysInit as well without globally exporting it
rtl/win/systlsdir.inc:
  * Exec_tls_callback: call SetupEntryInformation before initalizing the heap and multithreading so that the threadvar tables can be referenced correctly

git-svn-id: trunk@33035 -
2016-01-30 23:10:35 +00:00
svenbarth
e3060130a4 Adjustments so that the resource string related tables are provided inside the system unit (both for indirect and direct entry targets).
rtl/inc/system.inc:
  + new variables that hold pointers to the tables
  + new procedure SetupEntryInformation() that should be used in the entry points of indirect entry targets to setup cross target fields
  + for direct entry targets the two resource string tables are imported here and supplied as initialization to the table pointers
objpas/objpas.pp:
  * adjust table declarations so that the pointers provided from the System unit are used
  * adjust usages of the tables as they are now pointers
win32/system.pp:
  * Exe_Entry: use SetupEntryInformation()
win/syswin.inc:
  * Dll_Entry: use SetupEntryInformation()

git-svn-id: trunk@33028 -
2016-01-29 17:19:33 +00:00
svenbarth
7e1e947b71 asm_exit is only needed on Win32 (Note: the removal of asm_exit from TEntryInformation in the previous commit should have been in this one -.- )
rtl/win32/sysosh.inc:
  + add TEntryInformationOS for Win32 which contains asm_exit
rtl/win32/system.pp:
  * EntryInformation: adjust initialization
  * system_exit: call the correct function variable
rtl/win32/sysinit.inc:
  * SysInitEntryInformation: adjust initialization
  * SetupEntryInformation: adjust commented setup of the function variable
rtl/java/jsystemh_types.inc:
  * adjust TEntryInformation for consistency reasons

git-svn-id: trunk@33025 -
2016-01-29 15:36:58 +00:00
michael
10e7570948 * Applied patch from Thaddy de Koning (Bug ID 29405)
git-svn-id: trunk@32946 -
2016-01-15 17:30:48 +00:00
florian
d4d4689914 * use FormatMessageW in SysErrorMessage, resolves issue #29197
git-svn-id: trunk@32835 -
2016-01-03 15:56:31 +00:00
Tomas Hajny
b48b758a23 * fix for bug #29158 - added definition of REMOTE_NAME_INFOW (and REMOTE_NAME_INFOA), the W version used in ExpandUNCFileName now
git-svn-id: trunk@32692 -
2015-12-21 02:05:13 +00:00
marco
ffff774ff2 * fixes by lks of base.inc procptr types (one long->plong, three dword_ptr to ulong_ptr) fixes mantis #29023
git-svn-id: trunk@32456 -
2015-11-22 11:04:37 +00:00
marco
700a22f420 * revert accidentally committed part of executeprocess patch
git-svn-id: trunk@32334 -
2015-11-15 18:47:42 +00:00
marco
92960ff3ac * initial advanced records support for TSize..TRect and -F.
git-svn-id: trunk@32333 -
2015-11-15 18:34:19 +00:00
michael
aa7058e82d * Patch from Ondrej Pokorny to fix broken compilation after 32275
git-svn-id: trunk@32278 -
2015-11-09 07:36:01 +00:00
michael
fde42ca8ef * Type helpers, compatible to Delphi XE 8
git-svn-id: trunk@32262 -
2015-11-07 09:40:54 +00:00
marco
c402bffc69 * part of mantis 028134, cleanup of NORM_ constants
git-svn-id: trunk@30918 -
2015-05-26 17:44:09 +00:00
marco
076e43f799 * try to beautify image_delayload_descriptor a bit. But a 1:1 structure
is not possible I think (unless we forfeit the bitpack alternative)

git-svn-id: trunk@30279 -
2015-03-22 19:54:53 +00:00
marco
57212decc8 * ugly auto conversion IMAGE_IMPORT_DESCRIPTOR and _IMAGE_TLS_DIRECTORY64/32 fixed.
* IMAGE_EXPORT_DIRECTORY

(see comments mantis #27674 )

git-svn-id: trunk@30264 -
2015-03-20 14:01:28 +00:00
marco
882d42eb86 * change image_* macros to unsigned, half of bug #27674
git-svn-id: trunk@30256 -
2015-03-17 22:30:31 +00:00
marco
f79a8c1544 * IMAGE_FIRST_SECTION
git-svn-id: trunk@30185 -
2015-03-14 11:16:12 +00:00
marco
698a068da7 * Missing symbols from mantis #27657 except macro IMAGE_FIRST_SECTION
git-svn-id: trunk@30182 -
2015-03-13 20:08:29 +00:00
Tomas Hajny
dff7cb3c3c * added missing error constant
git-svn-id: trunk@29808 -
2015-02-23 11:19:50 +00:00
Tomas Hajny
b9f88aa80c * mapping of I/O error number 206 having different meaning in FPC to RTE 3
git-svn-id: trunk@29797 -
2015-02-22 22:25:44 +00:00
marco
8e2f8d7f3c * for wince use getprocessaddresa, mantis #27450
git-svn-id: trunk@29684 -
2015-02-13 10:23:05 +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
marco
43121ed5e1 * Fix for #27228
git-svn-id: trunk@29365 -
2015-01-01 00:27:18 +00:00
pierre
7bbb30ccd4 * Reset filerec mode field to fmClosed if the system call to open the file failed
git-svn-id: trunk@29132 -
2014-11-23 21:49:29 +00:00
pierre
90537e94a0 Call Errno2noutres if system call to close the handle fails in do_close for win and unix
git-svn-id: trunk@29095 -
2014-11-20 22:00:35 +00:00
pierre
260c6583cf Only set StdInputHandle, StdOutputHandle and StdErrorHandle once
git-svn-id: trunk@29094 -
2014-11-20 21:57:15 +00:00
marco
3fbcca0e77 * change ulargeinteger quadpart to unsinged, mantis #27023
git-svn-id: trunk@29059 -
2014-11-11 08:30:14 +00:00
marco
20833d4bc9 * change ContextTrackingMode field to boolean. Mantis #26892
git-svn-id: trunk@28883 -
2014-10-19 20:30:11 +00:00
marco
bcfe5eb146 * large image aware PE flag value. Fixes Delphi programs that set peflags with constant.
git-svn-id: trunk@28737 -
2014-10-04 11:14:56 +00:00
svenbarth
b79e7ce1f9 Implement GetCPUCount for Windows OSes. This is for all three Windows targets.
rtl/win/sysos.inc:
  + add definition of TSystemInfo structure
  + add import of GetSystemInfo
  + add implementation of GetCPUCount which returns value for number of processors retrieved by GetSystemInfo

git-svn-id: trunk@28643 -
2014-09-12 18:40:59 +00:00
marco
eb67f66e10 * add taglogfont out of compatibility, patch by Ocean, mantis #0026539
git-svn-id: trunk@28470 -
2014-08-19 17:45:23 +00:00
marco
a4a11cb149 * startupinfo was declared with lpTstr. splitted in the usual A/W/- variants
git-svn-id: trunk@28240 -
2014-07-19 22:22:49 +00:00
marco
0a0739b916 * improved winexec comment, updated copyright year and add minor comment to gettickcount64
Mantis #26238

git-svn-id: trunk@27834 -
2014-05-31 14:47:31 +00:00
michael
d5a88caecd * Do not display error message if NoErrMsg is set.
git-svn-id: trunk@27765 -
2014-05-11 10:19:04 +00:00
marco
959ea7f5bb * printer unit moved. Amiga unit also moved but it is not actively used.
git-svn-id: trunk@27351 -
2014-03-29 20:35:28 +00:00
nickysn
fb20791cbe * replaced all the remaining uses of nativeint in the rtl with either sizeint
or objpasint

git-svn-id: trunk@27237 -
2014-03-23 13:38:16 +00:00
sergei
e79e038f9c + Win32/Win64 SEH: STATUS_FLOAT_MULTIPLE_(FAULTS|TRAPS) need additional handling. Makes floating-point exceptions consistent between x87 and SSE.
git-svn-id: trunk@27177 -
2014-03-17 22:49:29 +00:00
nickysn
5242ed7864 * changed TResStrInitTable.Count and TWStrInitTablesTable.Count to nativeint
git-svn-id: trunk@26921 -
2014-03-02 13:27:59 +00:00